From f9ef1a34bd662b7044707df94c6124d22f00a465 Mon Sep 17 00:00:00 2001 From: pplokijuhyg <1162963624@qq.com> Date: Tue, 24 Dec 2019 16:32:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.wxss | 2 +- components/classify/navigation/index.js | 7 +++-- components/classify/navigation/index.wxml | 3 +- components/index/search/index.scss | 2 +- components/index/search/index.wxss | 2 +- components/order/commodity/index.scss | 2 +- components/order/commodity/index.wxss | 2 +- components/order/message/index.scss | 2 +- components/order/message/index.wxss | 2 +- .../orderchooseaddr/orderchooseaddr.js | 5 ++- .../orderchooseaddr/orderchooseaddr.wxml | 8 ++--- .../orderchooseway/orderchooseway.js | 14 +++++++-- .../orderchooseway/orderchooseway.wxml | 10 +++--- components/seles/merchandises/index.scss | 2 +- components/seles/merchandises/index.wxss | 2 +- .../shopping/shoppingitem/shoppingitem.js | 3 +- pages/addaddress/addaddress.js | 4 +++ pages/addaddress/addaddress.wxml | 2 +- pages/chooseaddr/chooseaddr.js | 17 ++++++++-- pages/classify/classify.js | 2 +- pages/classify/classify.wxml | 2 +- pages/message/message.scss | 2 +- pages/message/message.wxss | 2 +- pages/orderconfirm/orderconfirm.js | 10 +++++- pages/orderconfirm/orderconfirm.json | 3 +- pages/orderconfirm/orderconfirm.wxml | 2 +- pages/personal/personal.js | 31 +++++++++++++++---- pages/personal/personal.wxml | 6 ++-- pages/product/product.scss | 2 +- pages/product/product.wxss | 2 +- pages/shopping/shopping.js | 15 ++++++++- pages/shopping/shopping.wxml | 2 +- pages/undetermined/undetermined.js | 3 -- utils/bin.js | 16 ++++++++-- 34 files changed, 136 insertions(+), 55 deletions(-) diff --git a/app.wxss b/app.wxss index 8abb3a3..93d8393 100644 --- a/app.wxss +++ b/app.wxss @@ -364,5 +364,5 @@ template { } image { background-size: cover; - background-image: url("http://luyuan.tk/static/images/TIM%E5%9B%BE%E7%89%8720191214113605.jpg"); + /* background-image: url("http://luyuan.tk/static/images/TIM%E5%9B%BE%E7%89%8720191214113605.jpg"); */ } diff --git a/components/classify/navigation/index.js b/components/classify/navigation/index.js index 5be40b4..a155751 100644 --- a/components/classify/navigation/index.js +++ b/components/classify/navigation/index.js @@ -1,16 +1,17 @@ Component({ properties: { - types: Array + types: Array, + ids: Number + }, data: { - id: 0 }, methods: { select(a) { // console.log(this.data.a.target.dataset.id) // console.log(a.target.dataset.id) this.setData({ - id: a.target.dataset.id + ids: a.target.dataset.id }) this.triggerEvent("select",{id:a.target.dataset.id}) } diff --git a/components/classify/navigation/index.wxml b/components/classify/navigation/index.wxml index 6e2d6f0..921f8bf 100644 --- a/components/classify/navigation/index.wxml +++ b/components/classify/navigation/index.wxml @@ -1,5 +1,6 @@ - {{item.name}} + + {{item.name}} - + diff --git a/pages/chooseaddr/chooseaddr.js b/pages/chooseaddr/chooseaddr.js index 93ebed3..50f6bf2 100644 --- a/pages/chooseaddr/chooseaddr.js +++ b/pages/chooseaddr/chooseaddr.js @@ -1,5 +1,5 @@ // pages/chooseaddr/chooseaddr.js -import { request } from "../../utils/bin" +import { request,getuserid } from "../../utils/bin" Page({ /** @@ -36,9 +36,20 @@ Page({ }, add() { - wx.navigateTo({ - url: "/pages/addaddress/addaddress" + getuserid().then((id)=>{ + if(id == 0){ + wx.showToast({ + title: '请先登陆', + icon: 'none', + duration: 2000 + }) + }else{ + wx.navigateTo({ + url: "/pages/addaddress/addaddress" + }) + } }) + }, // user_id/8/id/215 delete(e){ diff --git a/pages/classify/classify.js b/pages/classify/classify.js index b64786f..648cee2 100644 --- a/pages/classify/classify.js +++ b/pages/classify/classify.js @@ -35,7 +35,7 @@ Page({ request({ url:'Goods/goodsList', urldata:{ - id:a.detail.id, + cat_id:a.detail.id, sort:'shop_price', sort_asc:'desc', p:0 diff --git a/pages/classify/classify.wxml b/pages/classify/classify.wxml index b25d1b3..31ebd31 100644 --- a/pages/classify/classify.wxml +++ b/pages/classify/classify.wxml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/pages/message/message.scss b/pages/message/message.scss index efd56df..8688a32 100644 --- a/pages/message/message.scss +++ b/pages/message/message.scss @@ -35,7 +35,7 @@ >image{ width: 50rpx; height: 41rpx; - background-color: #000; + // background-color: #000; margin: 77rpx 73rpx; } } diff --git a/pages/message/message.wxss b/pages/message/message.wxss index 037e454..97cd85a 100644 --- a/pages/message/message.wxss +++ b/pages/message/message.wxss @@ -1 +1 @@ -.box{display:flex;flex-direction:column;align-items:center}.box .list{width:650rpx}.box .list .information{margin-top:43rpx;display:flex;flex-direction:column;font-size:28rpx;color:#333;border-bottom:1rpx solid #eaeaea;justify-content:space-between}.box .list .information>input{height:28rpx;font-size:28rpx;color:#333}.box .upload{width:650rpx;margin-top:42rpx}.box .upload .title{font-size:26rpx;color:#999}.box .upload .files{margin-top:42rpx;width:195rpx;height:195rpx;box-shadow:2rpx 3rpx 16rpx 1rpx rgba(51,51,51,0.1)}.box .upload .files>image{width:50rpx;height:41rpx;background-color:#000;margin:77rpx 73rpx}.box .submit{margin-top:295rpx;width:650rpx;height:98rpx;background-color:#47C877;border-radius:49rpx;font-size:36rpx;line-height:98rpx;text-align:center;color:#fff} +.box{display:flex;flex-direction:column;align-items:center}.box .list{width:650rpx}.box .list .information{margin-top:43rpx;display:flex;flex-direction:column;font-size:28rpx;color:#333;border-bottom:1rpx solid #eaeaea;justify-content:space-between}.box .list .information>input{height:28rpx;font-size:28rpx;color:#333}.box .upload{width:650rpx;margin-top:42rpx}.box .upload .title{font-size:26rpx;color:#999}.box .upload .files{margin-top:42rpx;width:195rpx;height:195rpx;box-shadow:2rpx 3rpx 16rpx 1rpx rgba(51,51,51,0.1)}.box .upload .files>image{width:50rpx;height:41rpx;margin:77rpx 73rpx}.box .submit{margin-top:295rpx;width:650rpx;height:98rpx;background-color:#47C877;border-radius:49rpx;font-size:36rpx;line-height:98rpx;text-align:center;color:#fff} diff --git a/pages/orderconfirm/orderconfirm.js b/pages/orderconfirm/orderconfirm.js index feb12ab..7317034 100644 --- a/pages/orderconfirm/orderconfirm.js +++ b/pages/orderconfirm/orderconfirm.js @@ -39,7 +39,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - + this.onLoad() }, /** @@ -77,6 +77,14 @@ Page({ }, sub() { + if(this.data.list.addressList == null){ + wx.showToast({ + title:"请先添加地址", + icon:"none" + }) + console.log(123) + return ; + } bin.getuserid().then((res) => { bin.request({ url: "Cart/cart3", diff --git a/pages/orderconfirm/orderconfirm.json b/pages/orderconfirm/orderconfirm.json index a4e369c..49d4ef6 100644 --- a/pages/orderconfirm/orderconfirm.json +++ b/pages/orderconfirm/orderconfirm.json @@ -1,5 +1,6 @@ { - "component": true, + "navigationBarTitleText": "支付", + "component": true, "usingComponents": { "shopinfo": "/components/orderconfirm/ordershopinfo/ordershopinfo", "chooseway": "/components/orderconfirm/orderchooseway/orderchooseway", diff --git a/pages/orderconfirm/orderconfirm.wxml b/pages/orderconfirm/orderconfirm.wxml index c2cfa17..6d02361 100644 --- a/pages/orderconfirm/orderconfirm.wxml +++ b/pages/orderconfirm/orderconfirm.wxml @@ -2,7 +2,7 @@ - + diff --git a/pages/personal/personal.js b/pages/personal/personal.js index 1920bea..ae05190 100644 --- a/pages/personal/personal.js +++ b/pages/personal/personal.js @@ -7,14 +7,20 @@ Page({ */ data: { openid:"", - username:"啦啦啦" + username:"", + img:"", + frozen_money:"" }, /** * 生命周期函数--监听页面加载 */ onLoad: function(options) { - + // request({ + // url:"User/validateOpenid" + // }).then((res)=>{ + + // }) }, toorder() { wx.navigateTo({ @@ -58,7 +64,11 @@ Page({ */ login(){ if(this.data.openid == ""){ - wx.navigateTo({ + wx.navigateTo({ // request({ + // url:"User/validateOpenid" + // }).then((res)=>{ + + // }) url:"/pages/login/login" }) } @@ -71,13 +81,22 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function() { - this.setData({ - openid:wx.getStorageSync("openid") - }) + // this.setData({ + // openid:wx.getStorageSync("openid") + // }) request({ url:"User/validateOpenid" }).then((res)=>{ + // console.log(res) console.log(res) + if(res.data.code != 400){ + this.setData({ + username:res.data.data.nick_name, + img:res.data.data.head_pic, + frozen_money:res.data.data.frozen_money + }) + + } }) }, diff --git a/pages/personal/personal.wxml b/pages/personal/personal.wxml index 1039351..a9afa83 100644 --- a/pages/personal/personal.wxml +++ b/pages/personal/personal.wxml @@ -1,12 +1,12 @@ - - {{openid == ""?'点击登录':username}} + + {{username == ""?'点击登录':username}} 账户余额 - 480.00 + {{frozen_money}} diff --git a/pages/product/product.scss b/pages/product/product.scss index f75f9ba..e5fe704 100644 --- a/pages/product/product.scss +++ b/pages/product/product.scss @@ -11,7 +11,7 @@ .image{ width: 389rpx; height: 549rpx; - background-color: #000; + // background-color: #000; } } .title{ diff --git a/pages/product/product.wxss b/pages/product/product.wxss index ec1f3b5..6fc4f88 100644 --- a/pages/product/product.wxss +++ b/pages/product/product.wxss @@ -1 +1 @@ -.wxParse{margin:0 5px;font-family:Helvetica,sans-serif;font-size:28rpx;color:#666;line-height:1.8}view{word-break:break-all;overflow:auto}.wxParse-inline{display:inline;margin:0;padding:0}.wxParse-div{margin:0;padding:0}.wxParse-h1{font-size:2em;margin:.67em 0}.wxParse-h2{font-size:1.5em;margin:.75em 0}.wxParse-h3{font-size:1.17em;margin:.83em 0}.wxParse-h4{margin:1.12em 0}.wxParse-h5{font-size:.83em;margin:1.5em 0}.wxParse-h6{font-size:.75em;margin:1.67em 0}.wxParse-h1{font-size:18px;font-weight:400;margin-bottom:.9em}.wxParse-h2{font-size:16px;font-weight:400;margin-bottom:.34em}.wxParse-h3{font-weight:400;font-size:15px;margin-bottom:.34em}.wxParse-h4{font-weight:400;font-size:14px;margin-bottom:.24em}.wxParse-h5{font-weight:400;font-size:13px;margin-bottom:.14em}.wxParse-h6{font-weight:400;font-size:12px;margin-bottom:.04em}.wxParse-h1,.wxParse-h2,.wxParse-h3,.wxParse-h4,.wxParse-h5,.wxParse-h6,.wxParse-b,.wxParse-strong{font-weight:bolder}.wxParse-i,.wxParse-cite,.wxParse-em,.wxParse-var,.wxParse-address{font-style:italic}.wxParse-pre,.wxParse-tt,.wxParse-code,.wxParse-kbd,.wxParse-samp{font-family:monospace}.wxParse-pre{white-space:pre}.wxParse-big{font-size:1.17em}.wxParse-small,.wxParse-sub,.wxParse-sup{font-size:.83em}.wxParse-sub{vertical-align:sub}.wxParse-sup{vertical-align:super}.wxParse-s,.wxParse-strike,.wxParse-del{text-decoration:line-through}.wxParse-strong,.wxParse-s{display:inline}.wxParse-a{color:deepskyblue;word-break:break-all;overflow:auto}.wxParse-video{text-align:center;margin:10px 0}.wxParse-video-video{width:100%}.wxParse-img{overflow:hidden}.wxParse-blockquote{margin:0;padding:10px 0 10px 5px;font-family:Courier, Calibri,"宋体";background:#f5f5f5;border-left:3px solid #dbdbdb}.wxParse-code,.wxParse-wxxxcode-style{display:inline;background:#f5f5f5}.wxParse-ul{margin:20rpx 10rpx}.wxParse-li,.wxParse-li-inner{display:flex;align-items:baseline;margin:10rpx 0}.wxParse-li-text{align-items:center;line-height:20px}.wxParse-li-circle{display:inline-flex;width:5px;height:5px;background-color:#333;margin-right:5px}.wxParse-li-square{display:inline-flex;width:10rpx;height:10rpx;background-color:#333;margin-right:5px}.wxParse-li-ring{display:inline-flex;width:10rpx;height:10rpx;border:2rpx solid #333;border-radius:50%;background-color:#fff;margin-right:5px}.wxParse-u{text-decoration:underline}.wxParse-hide{display:none}.WxEmojiView{align-items:center}.wxEmoji{width:16px;height:16px}.wxParse-tr{display:flex;border-right:1px solid #e0e0e0;border-bottom:1px solid #e0e0e0;border-top:1px solid #e0e0e0}.wxParse-th,.wxParse-td{flex:1;padding:5px;font-size:28rpx;border-left:1px solid #e0e0e0;word-break:break-all}.wxParse-td:last{border-top:1px solid #e0e0e0}.wxParse-th{background:#f0f0f0;border-top:1px solid #e0e0e0}.wxParse-del{display:inline}.wxParse-figure{overflow:hidden}.box{border-top:1rpx solid #eaeaea;display:flex;flex-direction:column;align-items:center}.box .swiper{margin-top:109rpx;width:389rpx;height:657rpx}.box .swiper .image{width:389rpx;height:549rpx;background-color:#000}.box .title{font-size:32rpx;color:#333;margin-bottom:34rpx;width:540rpx}.box .menery{font-size:34rpx;color:#666;margin-bottom:70rpx}.box .add{width:308rpx;height:98rpx;background-color:#50CA80;border-radius:49rpx;line-height:98rpx;font-size:34rpx;color:#fff;text-align:center;position:fixed;bottom:50rpx;left:221rpx} +.wxParse{margin:0 5px;font-family:Helvetica,sans-serif;font-size:28rpx;color:#666;line-height:1.8}view{word-break:break-all;overflow:auto}.wxParse-inline{display:inline;margin:0;padding:0}.wxParse-div{margin:0;padding:0}.wxParse-h1{font-size:2em;margin:.67em 0}.wxParse-h2{font-size:1.5em;margin:.75em 0}.wxParse-h3{font-size:1.17em;margin:.83em 0}.wxParse-h4{margin:1.12em 0}.wxParse-h5{font-size:.83em;margin:1.5em 0}.wxParse-h6{font-size:.75em;margin:1.67em 0}.wxParse-h1{font-size:18px;font-weight:400;margin-bottom:.9em}.wxParse-h2{font-size:16px;font-weight:400;margin-bottom:.34em}.wxParse-h3{font-weight:400;font-size:15px;margin-bottom:.34em}.wxParse-h4{font-weight:400;font-size:14px;margin-bottom:.24em}.wxParse-h5{font-weight:400;font-size:13px;margin-bottom:.14em}.wxParse-h6{font-weight:400;font-size:12px;margin-bottom:.04em}.wxParse-h1,.wxParse-h2,.wxParse-h3,.wxParse-h4,.wxParse-h5,.wxParse-h6,.wxParse-b,.wxParse-strong{font-weight:bolder}.wxParse-i,.wxParse-cite,.wxParse-em,.wxParse-var,.wxParse-address{font-style:italic}.wxParse-pre,.wxParse-tt,.wxParse-code,.wxParse-kbd,.wxParse-samp{font-family:monospace}.wxParse-pre{white-space:pre}.wxParse-big{font-size:1.17em}.wxParse-small,.wxParse-sub,.wxParse-sup{font-size:.83em}.wxParse-sub{vertical-align:sub}.wxParse-sup{vertical-align:super}.wxParse-s,.wxParse-strike,.wxParse-del{text-decoration:line-through}.wxParse-strong,.wxParse-s{display:inline}.wxParse-a{color:deepskyblue;word-break:break-all;overflow:auto}.wxParse-video{text-align:center;margin:10px 0}.wxParse-video-video{width:100%}.wxParse-img{overflow:hidden}.wxParse-blockquote{margin:0;padding:10px 0 10px 5px;font-family:Courier, Calibri,"宋体";background:#f5f5f5;border-left:3px solid #dbdbdb}.wxParse-code,.wxParse-wxxxcode-style{display:inline;background:#f5f5f5}.wxParse-ul{margin:20rpx 10rpx}.wxParse-li,.wxParse-li-inner{display:flex;align-items:baseline;margin:10rpx 0}.wxParse-li-text{align-items:center;line-height:20px}.wxParse-li-circle{display:inline-flex;width:5px;height:5px;background-color:#333;margin-right:5px}.wxParse-li-square{display:inline-flex;width:10rpx;height:10rpx;background-color:#333;margin-right:5px}.wxParse-li-ring{display:inline-flex;width:10rpx;height:10rpx;border:2rpx solid #333;border-radius:50%;background-color:#fff;margin-right:5px}.wxParse-u{text-decoration:underline}.wxParse-hide{display:none}.WxEmojiView{align-items:center}.wxEmoji{width:16px;height:16px}.wxParse-tr{display:flex;border-right:1px solid #e0e0e0;border-bottom:1px solid #e0e0e0;border-top:1px solid #e0e0e0}.wxParse-th,.wxParse-td{flex:1;padding:5px;font-size:28rpx;border-left:1px solid #e0e0e0;word-break:break-all}.wxParse-td:last{border-top:1px solid #e0e0e0}.wxParse-th{background:#f0f0f0;border-top:1px solid #e0e0e0}.wxParse-del{display:inline}.wxParse-figure{overflow:hidden}.box{border-top:1rpx solid #eaeaea;display:flex;flex-direction:column;align-items:center}.box .swiper{margin-top:109rpx;width:389rpx;height:657rpx}.box .swiper .image{width:389rpx;height:549rpx}.box .title{font-size:32rpx;color:#333;margin-bottom:34rpx;width:540rpx}.box .menery{font-size:34rpx;color:#666;margin-bottom:70rpx}.box .add{width:308rpx;height:98rpx;background-color:#50CA80;border-radius:49rpx;line-height:98rpx;font-size:34rpx;color:#fff;text-align:center;position:fixed;bottom:50rpx;left:221rpx} diff --git a/pages/shopping/shopping.js b/pages/shopping/shopping.js index 7ed1950..2294002 100644 --- a/pages/shopping/shopping.js +++ b/pages/shopping/shopping.js @@ -116,7 +116,20 @@ Page({ onReachBottom: function () { }, +gai(a){ + console.log(a) + for(let i in this.data.list){ + if(this.data.list[i].id == a.detail.id){ + let text = `list[${i}].goods_num` + this.setData({ + [text]:a.detail.num + }) + console.log(123) + } + } + this.num() +}, /** * 用户点击右上角分享 */ @@ -129,7 +142,7 @@ Page({ for (let i in this.data.select) { console.log(i) if (this.data.select[i]) { - num += parseFloat(this.data.list[i].goods_price) * 100 + num += parseFloat(this.data.list[i].goods_price) * 100 * this.data.list[i].goods_num sel++ } } diff --git a/pages/shopping/shopping.wxml b/pages/shopping/shopping.wxml index 79d9208..3138bf6 100644 --- a/pages/shopping/shopping.wxml +++ b/pages/shopping/shopping.wxml @@ -1,6 +1,6 @@ - +