ソースを参照

添加详情页

sharp-agezi 6 年 前
コミット
526d460eff

+ 2 - 2
app.js

@@ -137,8 +137,8 @@ App({
     fromUserId : '',//分享者的id
     fromUserRole : '',//分享者的role
     //servsers: "https://52yqf.cn/",
-    servsers: "https://www.daliangzao.net/",//正式库
-    // servsers: "https://dlz.info666.com/",//测试域名库
+    // servsers: "https://www.daliangzao.net/",//正式库
+    servsers: "https://dlz.info666.com/",//测试域名库
     //servsers: "https://tt.daliangzao.net/",//测试库
     appid: 'wxf9a0ddcb8c70b939',//appid
     secret: 'a009cb3e46c8ecef9c54a50522f11823',//secret

+ 2 - 1
app.json

@@ -106,7 +106,8 @@
         "pages/user/user",
         "pages/address/add/add",
         "pages/order/order",
-        "pages/result/result"
+        "pages/result/result",
+        "pages/goodsDetail/goodsDetail"
       ]
     }
   ],

+ 77 - 0
customized/pages/goodsDetail/goodsDetail.js

@@ -0,0 +1,77 @@
+// customized/pages/goodsDetail/goodsDetail.js
+let app = getApp();
+let host = app.globalData.servsers; // 请求的url
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    detail: {},
+    host: host
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    let detail = wx.getStorageSync('detail');
+    this.setData({
+      detail: detail
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  },
+  hrefBtn() {
+    wx.navigateTo({
+      url: "/customized/pages/made/made",
+    })
+  }
+})

+ 3 - 0
customized/pages/goodsDetail/goodsDetail.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 12 - 0
customized/pages/goodsDetail/goodsDetail.wxml

@@ -0,0 +1,12 @@
+<view>
+  <view class='gd-left gd-public f-s34 c-green' bindtap="hrefBtn">
+    <text class="gd-circle">售</text>
+    <text>设计</text>
+  </view>
+  <view class='gd-right gd-public f-s36' bindtap="hrefBtn"> 
+    <text>DIY定制</text>
+  </view>
+</view>
+<view>
+  <image class="gd-img" src='{{host}}/{{detail.customgoodsImgDetail}}' mode="widthFix"></image>
+</view>

+ 34 - 0
customized/pages/goodsDetail/goodsDetail.wxss

@@ -0,0 +1,34 @@
+.gd-public{
+    position:fixed;
+    top:100rpx;
+    z-index:10;
+    width:204rpx;
+    height:92rpx;
+    text-align:center;
+    line-height:92rpx;
+    box-shadow: #aaa 0px 1px 5px 0px;
+    background:#fff;
+}
+.gd-circle{
+    display:inline-block;
+    width:50rpx;
+    height:50rpx;
+    text-align:center;
+    line-height:50rpx;
+    border-radius:50%;
+    border:2rpx solid #00af66;
+    margin-right:20rpx;
+}
+.gd-left{
+    left:0;
+    border-radius:0 20rpx 20rpx 0;
+}
+.gd-right{
+    right:0;
+    border-radius:20rpx 0rpx 0rpx 20rpx;
+    font-weight: bold;
+    color:#000;
+}
+.gd-img{
+    width:100%;
+}

+ 35 - 32
customized/pages/index/index.js

@@ -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
     })
   }
 

+ 1 - 1
customized/pages/index/index.wxml

@@ -1,5 +1,5 @@
 <view class="auto">
-  <view wx:for="{{madeList}}" class="f-box mar-t20 custom-list" data-state="{{item.customgoodsIsAllow}}" bindtap='customized'>
+  <view wx:for="{{madeList}}" class="f-box mar-t20 custom-list" data-detail="{{item}}" data-state="{{item.customgoodsIsAllow}}" bindtap='customized'>
     <view class='cust-img mar-r20 mar-l20 f-box f-align-items-center'>
       <image src="{{host}}/{{item.customgoodsNameImgJson}}" mode="aspectFit"></image>
     </view>

+ 7 - 1
project.config.json

@@ -28,7 +28,7 @@
 			"list": []
 		},
 		"miniprogram": {
-			"current": 14,
+			"current": 15,
 			"list": [
 				{
 					"id": 0,
@@ -129,6 +129,12 @@
 					"pathName": "customized/pages/index/index",
 					"query": "",
 					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "详情",
+					"pathName": "customized/pages/goodsDetail/goodsDetail",
+					"scene": null
 				}
 			]
 		}

+ 3 - 0
style/customized.wxss

@@ -115,6 +115,9 @@ page{
 .f-s32{
   font-size:32rpx;
 }
+.f-s34{
+  font-size:34rpx;
+}
 .f-s36{
   font-size:36rpx;
 }

ファイルの差分が大きいため隠しています
+ 0 - 16
style/stylesheet.wxss


ファイルの差分が大きいため隠しています
+ 0 - 1
utils/youziku.api.min.js