|
@@ -8,14 +8,14 @@ Page({
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
- Length: 6, //输入框个数
|
|
|
- isFocus: true, //聚焦
|
|
|
- Value: "", //输入的内容
|
|
|
+ Length: 6, //输入框个数
|
|
|
+ isFocus: true, //聚焦
|
|
|
+ Value: "", //输入的内容
|
|
|
ispassword: true, //是否密文显示 true为密文, false为明文。
|
|
|
- pwdStatic:false, // 密码状态框,是否显示
|
|
|
- carNum:null,
|
|
|
- host:host,
|
|
|
- madeList:[
|
|
|
+ pwdStatic: false, // 密码状态框,是否显示
|
|
|
+ carNum: null,
|
|
|
+ host: host,
|
|
|
+ madeList: [
|
|
|
// {
|
|
|
// src:'/customized/images/customized/cup_black_small.png',
|
|
|
// name:'奶缸-黑色 350ml',
|
|
@@ -55,23 +55,25 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|
|
|
onReady: function () {
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow: function () {
|
|
|
- let data = this.data.Value ? {channalPwd: this.data.Value}: false
|
|
|
- this.getMadeList(this,data); // 获取商品列表
|
|
|
- this.getCarlist(this);//获取购物车列表
|
|
|
+ let data = this.data.Value ? {
|
|
|
+ channalPwd: this.data.Value
|
|
|
+ } : false
|
|
|
+ this.getMadeList(this, data); // 获取商品列表
|
|
|
+ this.getCarlist(this); //获取购物车列表
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -108,8 +110,8 @@ Page({
|
|
|
onShareAppMessage: function () {
|
|
|
|
|
|
},
|
|
|
- customized(e){
|
|
|
- if (e.currentTarget.dataset.state == '1'){
|
|
|
+ customized(e) {
|
|
|
+ if (e.currentTarget.dataset.state == '1') {
|
|
|
return;
|
|
|
}
|
|
|
console.log('canvas')
|
|
@@ -120,8 +122,9 @@ Page({
|
|
|
url: '/pages/authorize/authorize?link=customized',
|
|
|
})
|
|
|
} else {
|
|
|
+ wx.setStorageSync('detail', e.currentTarget.dataset.detail)
|
|
|
wx.navigateTo({
|
|
|
- url: "/customized/pages/made/made",
|
|
|
+ url: "/customized/pages/goodsDetail/goodsDetail",
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -133,7 +136,7 @@ Page({
|
|
|
'content-type': 'application/x-www-form-urlencoded'
|
|
|
},
|
|
|
data: {
|
|
|
- userId: app.globalData.user_id //app.globalData.user_id //'oovpNwjlsY6xx8ceCebFa1dOLd9E' //app.globalData.user_id,
|
|
|
+ userId: app.globalData.user_id //app.globalData.user_id //'oovpNwjlsY6xx8ceCebFa1dOLd9E' //app.globalData.user_id,
|
|
|
},
|
|
|
success: function (res) {
|
|
|
console.log('购物车列表数据', res)
|
|
@@ -143,43 +146,43 @@ Page({
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- getMadeList(that,data){ // 获取列表
|
|
|
+ getMadeList(that, data) { // 获取列表
|
|
|
wx.showLoading({
|
|
|
title: '加载中...',
|
|
|
})
|
|
|
wx.request({
|
|
|
- url: host+ '/custom/queryNotOpenCustomGoodsByPwd',
|
|
|
- method:'get',
|
|
|
+ url: host + '/custom/queryNotOpenCustomGoodsByPwd',
|
|
|
+ method: 'get',
|
|
|
header: {
|
|
|
'content-type': 'application/x-www-form-urlencoded'
|
|
|
},
|
|
|
- data:data? data:{},
|
|
|
- success(res){
|
|
|
+ data: data ? data : {},
|
|
|
+ success(res) {
|
|
|
console.log(res)
|
|
|
- if(res.data.length === 0 && data){
|
|
|
+ if (res.data.length === 0 && data) {
|
|
|
wx.showToast({
|
|
|
title: '密码输入错误',
|
|
|
- icon:'none'
|
|
|
+ icon: 'none'
|
|
|
})
|
|
|
} else {
|
|
|
that.setData({
|
|
|
madeList: [...res.data]
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
- fail(err){
|
|
|
+ fail(err) {
|
|
|
console.log(err)
|
|
|
},
|
|
|
- complete(){
|
|
|
+ complete() {
|
|
|
console.log('完成');
|
|
|
wx.hideLoading()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- vipBtn(){ // 表示是vip操作
|
|
|
+ vipBtn() { // 表示是vip操作
|
|
|
this.setData({
|
|
|
- pwdStatic:true
|
|
|
+ pwdStatic: true
|
|
|
})
|
|
|
},
|
|
|
Focus(e) {
|
|
@@ -196,20 +199,20 @@ Page({
|
|
|
isFocus: true,
|
|
|
})
|
|
|
},
|
|
|
- fromDel(){
|
|
|
+ fromDel() {
|
|
|
this.setData({
|
|
|
Value: "",
|
|
|
})
|
|
|
},
|
|
|
formSubmit(e) {
|
|
|
console.log(this.data.Value);
|
|
|
- this.getMadeList(this,{
|
|
|
+ this.getMadeList(this, {
|
|
|
channalPwd: this.data.Value
|
|
|
})
|
|
|
},
|
|
|
- close(){
|
|
|
+ close() {
|
|
|
this.setData({
|
|
|
- pwdStatic:false
|
|
|
+ pwdStatic: false
|
|
|
})
|
|
|
}
|
|
|
|