Commit 655b6538 by zujiaozhang

'修改了删除图片的提示'

parent 7c0f4abd
......@@ -29,15 +29,19 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
// console.log(furtherConsultation.flag)
// 点击删除图片
$('#ImgUp').on('click', '.image_del', function() {
var that = $(this)
var src = $(this).siblings('img').attr('src')
var index = furtherConsultation.imgList.findIndex(function(item){
return item = src
})
console.log(index)
if (confirm('确定要删除图片吗?')) {
furtherConsultation.imgList.splice(index,1)
$(this).parent().remove();
mui.confirm('确定要删除这张图片吗?',function(e){
if(e.index==1){
furtherConsultation.imgList.splice(index,1)
that.parent().remove();
}else if(e.index==0){
console.log('取消了')
}
})
});
// 用户点击了无
$('.noHas').on('tap',function(){
......
......@@ -32,14 +32,19 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
init: function(){
// 点击删除图片
$('#ImgUp').on('click', '.image_del', function() {
var that = $(this)
var src = $(this).siblings('img').attr('src')
var index = geneDetection.imgList.findIndex(function(item){
return item = src
})
if (confirm('确定要删除图片吗?')) {
geneDetection.imgList.splice(index,1)
$(this).parent().remove();
}
mui.confirm('确定要删除这张图片吗?',function(e){
if(e.index==1){
geneDetection.imgList.splice(index,1)
that.parent().remove();
}else if(e.index==0){
console.log('取消了')
}
})
});
// 用户点击了无
$('.noHas').on('tap',function(){
......
......@@ -55,14 +55,19 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
}
// 点击删除图片
$('#ImgUp').on('click', '.image_del', function() {
var that = $(this)
var src = $(this).siblings('img').attr('src')
var index = generalPage.imgList.findIndex(function(item){
return item = src
})
if (confirm('确定要删除图片吗?')) {
mui.confirm('确定要删除这张图片吗?',function(e){
if(e.index==1){
generalPage.imgList.splice(index,1)
$(this).parent().remove();
that.parent().remove();
}else if(e.index==0){
console.log('取消了')
}
})
});
// 点击下一题
$('.next').on('click',function(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment