...
|
...
|
@@ -47,14 +47,14 @@ Page({ |
|
|
videosrc: "",
|
|
|
tvphide: false,
|
|
|
vid: '',
|
|
|
sownloadnum:false,
|
|
|
payres:'',
|
|
|
beizhu:false,
|
|
|
sownloadnum: false,
|
|
|
payres: '',
|
|
|
beizhu: false,
|
|
|
selectaddress: '请选择收货地址',
|
|
|
shname: '请选择收货人',
|
|
|
shmobile:'收货电话',
|
|
|
detailaddress:'详细地地址',
|
|
|
state:''
|
|
|
shmobile: '收货电话',
|
|
|
detailaddress: '详细地地址',
|
|
|
state: ''
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -64,11 +64,12 @@ Page({ |
|
|
let that = this;
|
|
|
console.log(options.free)
|
|
|
this.setData({
|
|
|
shopid: options.id
|
|
|
shopid: options.id,
|
|
|
platform: wx.getStorageSync('device')
|
|
|
})
|
|
|
that.showbtn()
|
|
|
|
|
|
|
|
|
|
|
|
console.log(this.data.defo);
|
|
|
console.log(this.data.vid);
|
|
|
// this.txvContext = txvContext.getTxvContext('myVideo');
|
...
|
...
|
@@ -77,17 +78,17 @@ Page({ |
|
|
},
|
|
|
|
|
|
//是否显示按钮、
|
|
|
showbtn(){
|
|
|
showbtn() {
|
|
|
let that = this;
|
|
|
var url = '/home/Welcome/paySwitch';
|
|
|
var params = {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
app.post(url, params).then((res) => {
|
|
|
console.log(res);
|
|
|
that.setData({
|
|
|
state:res.state
|
|
|
state: res.state
|
|
|
})
|
|
|
|
|
|
|
...
|
...
|
@@ -152,7 +153,7 @@ Page({ |
|
|
})
|
|
|
} else if (that.data.pic == true && that.data.pdf == false) {
|
|
|
|
|
|
|
|
|
|
|
|
var url = '/home/Goods/freeDownload';
|
|
|
var params = {
|
|
|
id: that.data.shopid,
|
...
|
...
|
@@ -164,8 +165,8 @@ Page({ |
|
|
'XX-Token': wx.getStorageSync('token'),
|
|
|
'XX-Device-Type': 'wxapp'
|
|
|
}
|
|
|
app.post(url,params,header).then((res) => {
|
|
|
|
|
|
app.post(url, params, header).then((res) => {
|
|
|
|
|
|
console.log(res)
|
|
|
if (res.msg == "下载成功") {
|
|
|
wx.navigateTo({
|
...
|
...
|
@@ -176,18 +177,18 @@ Page({ |
|
|
title: res.msg,
|
|
|
icon: 'none'
|
|
|
})
|
|
|
} else if (res.msg == "您还未填写问卷"){
|
|
|
} else if (res.msg == "您还未填写问卷") {
|
|
|
wx.showToast({
|
|
|
title: res.msg,
|
|
|
icon: 'none'
|
|
|
})
|
|
|
|
|
|
|
|
|
setTimeout(function(){
|
|
|
setTimeout(function () {
|
|
|
wx.navigateTo({
|
|
|
url: '../../questionsurvey/questionsurvey',
|
|
|
})
|
|
|
},1500)
|
|
|
}, 1500)
|
|
|
}
|
|
|
|
|
|
// that.setData({
|
...
|
...
|
@@ -202,22 +203,21 @@ Page({ |
|
|
}).catch((err) => {
|
|
|
|
|
|
console.log(err)
|
|
|
if (err.msg == '您还未填写问卷'){
|
|
|
if (err.msg == '您还未填写问卷') {
|
|
|
wx.showToast({
|
|
|
title: '您还未填写问卷',
|
|
|
icon:'none'
|
|
|
icon: 'none'
|
|
|
})
|
|
|
setTimeout(function(){
|
|
|
setTimeout(function () {
|
|
|
wx.navigateTo({
|
|
|
url: '../../questionsurvey/questionsurvey',
|
|
|
})
|
|
|
},1500)
|
|
|
} else if (err.msg == '今日下载次数已用尽'){
|
|
|
}, 1500)
|
|
|
} else if (err.msg == '今日下载次数已用尽') {
|
|
|
wx.showToast({
|
|
|
title: '今日下载次数已用尽',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
|
|
|
}
|
|
|
})
|
|
|
|
...
|
...
|
@@ -255,20 +255,29 @@ Page({ |
|
|
})
|
|
|
}
|
|
|
}).catch((err) => {
|
|
|
console.log(err)
|
|
|
wx.showToast({
|
|
|
title: '您还未填写问卷',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
|
|
|
|
|
|
setTimeout(function () {
|
|
|
wx.navigateTo({
|
|
|
url: '../../questionsurvey/questionsurvey',
|
|
|
if (err.msg == '您还未填写问卷') {
|
|
|
wx.showToast({
|
|
|
title: '您还未填写问卷',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
}, 1500)
|
|
|
setTimeout(function () {
|
|
|
wx.navigateTo({
|
|
|
url: '../../questionsurvey/questionsurvey',
|
|
|
})
|
|
|
}, 1500)
|
|
|
} else if (err.msg == '今日下载次数已用尽') {
|
|
|
wx.showToast({
|
|
|
title: '今日下载次数已用尽',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
}
|
|
|
// setTimeout(function () {
|
|
|
// wx.navigateTo({
|
|
|
// url: '../../questionsurvey/questionsurvey',
|
|
|
// })
|
|
|
// }, 1500)
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
}
|
|
|
|
...
|
...
|
@@ -495,7 +504,7 @@ Page({ |
|
|
console.log(res);
|
|
|
|
|
|
if (res.goods_price == '免费') {
|
|
|
|
|
|
|
|
|
this.setData({
|
|
|
isfree: 0
|
|
|
})
|
...
|
...
|
@@ -507,23 +516,23 @@ Page({ |
|
|
|
|
|
})
|
|
|
|
|
|
if (res.goods_content!=null){
|
|
|
if (res.goods_content != null) {
|
|
|
|
|
|
wxParse.wxParse('content', 'html', res.goods_content, that, 5);
|
|
|
}
|
|
|
|
|
|
|
|
|
} else {
|
|
|
console.log(888)
|
|
|
if (res.is_purchased==true) {
|
|
|
if (res.is_purchased == true) {
|
|
|
//购买过教案
|
|
|
this.setData({
|
|
|
isfree: 1
|
|
|
})
|
|
|
if (res.goods_content!=null){
|
|
|
if (res.goods_content != null) {
|
|
|
wxParse.wxParse('content', 'html', res.goods_content, that, 5);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
//没购买过教案
|
|
|
console.log(444)
|
...
|
...
|
@@ -531,15 +540,15 @@ Page({ |
|
|
isfree: 2
|
|
|
})
|
|
|
|
|
|
if (res.goods_content!=null){
|
|
|
if (res.goods_content != null) {
|
|
|
wxParse.wxParse('content', 'html', res.goods_content, that, 5);
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
...
|
...
|
@@ -671,7 +680,7 @@ Page({ |
|
|
that.setData({
|
|
|
logolurl: res.url.url,
|
|
|
logolfile: res.url.file,
|
|
|
changelogol:true
|
|
|
changelogol: true
|
|
|
})
|
|
|
}).catch((err) => {
|
|
|
console.log(err)
|
...
|
...
|
@@ -699,10 +708,14 @@ Page({ |
|
|
})
|
|
|
},
|
|
|
gobuy() {
|
|
|
|
|
|
this.data.platform == 'ios'?wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '十分抱歉,由于相关规范,您暂时无法在这里使用该功能',
|
|
|
showCancel: false
|
|
|
}):
|
|
|
this.setData({
|
|
|
selectrue: true,
|
|
|
defo:''
|
|
|
defo: ''
|
|
|
})
|
|
|
|
|
|
},
|
...
|
...
|
@@ -716,7 +729,7 @@ Page({ |
|
|
|
|
|
//确定支付
|
|
|
surebuy() {
|
|
|
let that=this;
|
|
|
let that = this;
|
|
|
|
|
|
that.setData({
|
|
|
// beizhu:true,
|
...
|
...
|
@@ -726,23 +739,23 @@ Page({ |
|
|
wx.showToast({
|
|
|
title: '请选择logo设置种类',
|
|
|
icon: 'none',
|
|
|
duration:5000
|
|
|
duration: 5000
|
|
|
})
|
|
|
} else {
|
|
|
|
|
|
|
|
|
if (that.data.goodtail.is_purchased==true){
|
|
|
wx.showToast({
|
|
|
title: '您已买过该教案,更换logo不需要付费',
|
|
|
icon:'none',
|
|
|
duration:2000,
|
|
|
|
|
|
})
|
|
|
|
|
|
}else{
|
|
|
if (that.data.goodtail.is_purchased == true) {
|
|
|
wx.showToast({
|
|
|
title: '您已买过该教案,更换logo不需要付费',
|
|
|
icon: 'none',
|
|
|
duration: 2000,
|
|
|
|
|
|
})
|
|
|
|
|
|
} else {
|
|
|
console.log(8989)
|
|
|
|
|
|
|
|
|
|
|
|
var url = '/home/Order/done';
|
|
|
var params = {
|
|
|
goods_id: that.data.shopid,
|
...
|
...
|
@@ -786,25 +799,25 @@ Page({ |
|
|
|
|
|
})
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
},
|
|
|
//隐藏收货地址
|
|
|
//隐藏收货地址
|
|
|
|
|
|
hidebeizhu(){
|
|
|
hidebeizhu() {
|
|
|
this.setData({
|
|
|
beizhu:false
|
|
|
beizhu: false
|
|
|
})
|
|
|
},
|
|
|
|
|
|
|
|
|
//收货地址购买
|
|
|
surego(){
|
|
|
//收货地址购买
|
|
|
surego() {
|
|
|
let that = this;
|
|
|
that.setData({
|
|
|
beizhu:false
|
|
|
beizhu: false
|
|
|
})
|
|
|
// this.setData({
|
|
|
// selectrue: false
|
...
|
...
|
@@ -873,22 +886,13 @@ Page({ |
|
|
icon: 'none'
|
|
|
})
|
|
|
} else {
|
|
|
// console.log(9090)
|
|
|
|
|
|
// that.setData({
|
|
|
// beizhu:true
|
|
|
// })
|
|
|
|
|
|
// console.log(that.data.beizhu)
|
|
|
var url = '/home/Order/done';
|
|
|
var params = {
|
|
|
goods_id: that.data.shopid,
|
|
|
is_custom_logo: that.data.is_custom_logo,
|
|
|
|
|
|
logo: that.data.logolfile,
|
|
|
email: that.data.email
|
|
|
}
|
|
|
|
|
|
var header = {
|
|
|
'XX-Token': wx.getStorageSync('token'),
|
|
|
'XX-Device-Type': 'wxapp'
|
...
|
...
|
@@ -899,35 +903,27 @@ Page({ |
|
|
that.setData({
|
|
|
sownloadnum: true
|
|
|
})
|
|
|
|
|
|
that.setData({
|
|
|
payres:res
|
|
|
payres: res
|
|
|
})
|
|
|
|
|
|
} else if (res.current_download_num==0){
|
|
|
} else if (res.current_download_num == 0) {
|
|
|
that.payment(res)
|
|
|
}
|
|
|
|
|
|
// that.payment(res)
|
|
|
|
|
|
|
|
|
// if(res==){
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
}).catch((err) => {
|
|
|
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
surechange(){
|
|
|
let that=this;
|
|
|
that.secpay()
|
|
|
surechange() {
|
|
|
let that = this;
|
|
|
that.secpay()
|
|
|
},
|
|
|
|
|
|
|
...
|
...
|
@@ -949,8 +945,8 @@ Page({ |
|
|
that.setData({
|
|
|
selectrue: false,
|
|
|
isfree: 1,
|
|
|
changelogol: false,
|
|
|
beizhu:false,
|
|
|
changelogol: false,
|
|
|
beizhu: false,
|
|
|
logolurl: "http://pnb2waalt.bkt.clouddn.com/uplogo.png"
|
|
|
})
|
|
|
|
...
|
...
|
@@ -961,13 +957,13 @@ Page({ |
|
|
},
|
|
|
|
|
|
//第二次更换支付
|
|
|
secpay(){
|
|
|
secpay() {
|
|
|
let that = this
|
|
|
wx.requestPayment({
|
|
|
timeStamp: that.data.payres.wx_pay.timeStamp,
|
|
|
nonceStr:that.data.payres.wx_pay.nonceStr,
|
|
|
nonceStr: that.data.payres.wx_pay.nonceStr,
|
|
|
package: that.data.payres.wx_pay.package,
|
|
|
signType:that.data.payres.wx_pay.signType,
|
|
|
signType: that.data.payres.wx_pay.signType,
|
|
|
paySign: that.data.payres.wx_pay.paySign,
|
|
|
success(res) {
|
|
|
console.log(res)
|
...
|
...
|
@@ -978,8 +974,8 @@ Page({ |
|
|
selectrue: false,
|
|
|
isfree: 1,
|
|
|
changelogol: false,
|
|
|
sownloadnum:false,
|
|
|
logolurl:"http://pnb2waalt.bkt.clouddn.com/uplogo.png"
|
|
|
sownloadnum: false,
|
|
|
logolurl: "http://pnb2waalt.bkt.clouddn.com/uplogo.png"
|
|
|
})
|
|
|
|
|
|
}
|
...
|
...
|
@@ -988,7 +984,7 @@ Page({ |
|
|
})
|
|
|
},
|
|
|
//隐藏第二次支付
|
|
|
cancelchange(){
|
|
|
cancelchange() {
|
|
|
this.setData({
|
|
|
sownloadnum: false
|
|
|
})
|
...
|
...
|
@@ -996,9 +992,14 @@ Page({ |
|
|
|
|
|
//更换logo
|
|
|
wantchangelogol() {
|
|
|
this.data.platform == 'ios' ? wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '十分抱歉,由于相关规范,您暂时无法在这里使用该功能',
|
|
|
showCancel: false
|
|
|
}):
|
|
|
this.setData({
|
|
|
selectrue: true,
|
|
|
defo:''
|
|
|
defo: ''
|
|
|
|
|
|
})
|
|
|
},
|
...
|
...
|
@@ -1028,7 +1029,7 @@ Page({ |
|
|
success(res) {
|
|
|
console.log(res)
|
|
|
that.setData({
|
|
|
selectaddress: res.provinceName + res.cityName + res.countyName ,
|
|
|
selectaddress: res.provinceName + res.cityName + res.countyName,
|
|
|
shname: res.userName,
|
|
|
shmobile: res.telNumber,
|
|
|
detailaddress: res.detailInfo
|
...
|
...
|
@@ -1074,10 +1075,10 @@ Page({ |
|
|
onShow: function () {
|
|
|
|
|
|
this.setData({
|
|
|
againdownhide:false,
|
|
|
againdownhide: false,
|
|
|
// changelogol:false,
|
|
|
// selectrue:false,
|
|
|
logolurl:''
|
|
|
logolurl: ''
|
|
|
})
|
|
|
this.getdetail();
|
|
|
},
|
...
|
...
|
|