This commit is contained in:
pplokijuhyg 2020-01-14 15:25:22 +08:00
parent 5f652d6183
commit 67682de4c7
13 changed files with 143 additions and 49 deletions

View File

@ -4,8 +4,8 @@ Component({
* 组件的属性列表
*/
properties: {
title:String,
placeholder:String
title: String,
placeholder: String
},
/**
@ -19,6 +19,8 @@ Component({
* 组件的方法列表
*/
methods: {
input(a) {
this.triggerEvent("input",{value:a.detail.value})
}
}
})

View File

@ -1,4 +1,4 @@
<view class="orderyf">
<view class="left">{{title}}</view>
<input class="right" placeholder="{{placeholder}}"></input>
<input class="right" bindinput="input" placeholder="{{placeholder}}"></input>
</view>

View File

@ -29,6 +29,7 @@ Component({
this.setData({
date: e.detail.value
})
this.triggerEvent("input",{date:e.detail.value})
},
getCurTime() {
var date = new Date();

View File

@ -6,7 +6,8 @@ Component({
number:String,
time:String,
text:String,
goods:Array
goods:Array,
ziti:String
},
data: {
},

View File

@ -15,7 +15,7 @@
</view>
<view class="message">
<text>配送方式</text>
<text>快递 </text>
<text>{{ziti == 1?"自提":"快递"}} </text>
</view>
<view class="leave">
<text>备注:</text>

View File

@ -7,7 +7,10 @@ Page({
*/
data: {
list: {},
fs:0
fs:0,
date:"",
phone:"",
name:""
},
/**
@ -78,56 +81,140 @@ Page({
},
sub() {
if (this.data.list.addressList == null) {
if (this.data.list.addressList == null && this.data.fs == 0) {
wx.showToast({
title: "请先添加地址",
icon: "none"
})
}
if ((!this.data.name || !this.data.phone || !this.data.date) && this.data.fs == 1) {
wx.showToast({
title: "请完善提货信息",
icon: "none"
})
console.log(123)
return;
}
bin.getuserid().then((res) => {
bin.request({
url: "Cart/cart3",
urldata: {
act: "",
submit_order: "",
user_id: res,
address_id: this.data.list.addressList.address_id,
user_money: 0,
pay_points: 0,
couponTypeSelect: 1,
coupon_id: 0,
pay_code: "weixin",
couponCode: ""
}
}).then((r) => {
console.log(r)
let { timeStamp, nonceStr, signType, sign } = r.data.data.wdata
// timeStamp = timeStamp
timeStamp = timeStamp.toString()
console.log(timeStamp)
wx.requestPayment({
timeStamp, nonceStr, package: r.data.data.wdata.package, signType, paySign: sign,
success(res) {
console.log("成功")
wx.redirectTo({
url: "/pages/order/order?index=1"
})
},
fail(res) { console.log(res)
wx.redirectTo({
url: "/pages/order/order?index=0"
})}
if(this.data.fs == 0){
bin.getuserid().then((res) => {
bin.request({
url: "Cart/cart3",
urldata: {
act: "",
submit_order: "",
user_id: res,
address_id: this.data.list.addressList.address_id,
user_money: 0,
pay_points: 0,
couponTypeSelect: 1,
coupon_id: 0,
pay_code: "weixin",
couponCode: ""
}
}).then((r) => {
console.log(r)
let { timeStamp, nonceStr, signType, sign } = r.data.data.wdata
// timeStamp = timeStamp
timeStamp = timeStamp.toString()
console.log(timeStamp)
wx.requestPayment({
timeStamp, nonceStr, package: r.data.data.wdata.package, signType, paySign: sign,
success(res) {
console.log("成功")
wx.redirectTo({
url: "/pages/order/order?index=1"
})
},
fail(res) { console.log(res)
wx.redirectTo({
url: "/pages/order/order?index=0"
})}
})
})
})
})
}else{
bin.getuserid().then((res) => {
bin.request({
url: "Cart/cart3",
urldata: {
act: "",
submit_order: "",
user_id: res,
user_money: 0,
pay_points: 0,
couponTypeSelect: 1,
coupon_id: 0,
pay_code: "weixin",
couponCode: "",
},
data:{
ziti_name:this.data.name,
ziti_phone:this.data.phone,
ziti_date:this.data.date,
delivery:"ziti"
}
}).then((r) => {
console.log(r)
let { timeStamp, nonceStr, signType, sign } = r.data.data.wdata
// timeStamp = timeStamp
timeStamp = timeStamp.toString()
console.log(timeStamp)
wx.requestPayment({
timeStamp, nonceStr, package: r.data.data.wdata.package, signType, paySign: sign,
success(res) {
console.log("成功")
wx.redirectTo({
url: "/pages/order/order?index=1"
})
},
fail(res) { console.log(res)
wx.redirectTo({
url: "/pages/order/order?index=0"
})}
})
})
})
}
},
tab(a){
console.log(a.detail.id)
bin.getuserid().then((res) => {
bin.request({
url: "Cart/cart2",
urldata: {
user_id: res
},
data:{
delivery:a.detail.id == 1 ? "ziti" : "express"
}
}).then((res) => {
console.log(res)
this.setData({
list: res.data.result
})
this.setData({
fs:a.detail.id
})
})
})
},
date(a){
this.setData({
fs:a.detail.id
date:a.detail.date
})
},
name(a){
this.setData({
name:a.detail.value
})
},
phone(a){
this.setData({
phone:a.detail.value
})
}
})

View File

@ -4,9 +4,9 @@
<chooseway bind:tab="tab"></chooseway>
<chooseaddr wx:if="{{fs == 0}}" name="{{list.addressList.consignee}}" addr="{{list.addressList.province? list.addressList.province + list.addressList.city + list.addressList.address:''}}" number="{{list.addressList.zipcode}}" phone="{{list.addressList.mobile}}"></chooseaddr>
<orderyf wx:if="{{fs == 0}}" price="{{list.express_price}}"></orderyf>
<time wx:if="{{fs == 1}}"></time>
<inputs wx:if="{{fs == 1}}" title="提货姓名" placeholder="请输入姓名"></inputs>
<inputs wx:if="{{fs == 1}}" title="联系手机" placeholder="请输入手机号"></inputs>
<time bind:input="date" wx:if="{{fs == 1}}"></time>
<inputs bind:input="name" wx:if="{{fs == 1}}" title="提货姓名" placeholder="请输入姓名"></inputs>
<inputs bind:input="phone" wx:if="{{fs == 1}}" title="联系手机" placeholder="请输入手机号"></inputs>
<agree></agree>
<view class="bottom">
<bottom price="{{list.totalPrice.total_fee}}" bind:sub="sub"></bottom>

View File

@ -1,4 +1,5 @@
{
"navigationBarTitleText": "订单详情",
"usingComponents": {
"content":"../components/particulars/content/index",
"orderchooseaddr":"../components/particulars/orderchooseaddr/index",

View File

@ -1,5 +1,5 @@
<view class="box">
<orderchooseaddr name="{{list.consignee}}" addr="{{list.address}}" phone="{{list.mobile}}"></orderchooseaddr>
<content num="{{list.num}}" price="{{list.goods_price}}" cprice="{{list.integral_money}}" number="{{list.order_sn}}" time="{{list.add_time}}" goods="{{list.goods_list}}" text="{{list.user_note}}"></content>
<content ziti="{{list.is_ziti}}" num="{{list.num}}" price="{{list.goods_price}}" cprice="{{list.integral_money}}" number="{{list.order_sn}}" time="{{list.add_time}}" goods="{{list.goods_list}}" text="{{list.user_note}}"></content>
<submit></submit>
</view>

View File

@ -1,4 +1,5 @@
{
"navigationBarTitleText": "订单详情",
"usingComponents": {
"content":"../components/particulars/content/index",
"orderchooseaddr":"../components/particulars/orderchooseaddr/index"

View File

@ -1,4 +1,4 @@
<view class="box">
<orderchooseaddr name="{{list.consignee}}" addr="{{list.address}}" phone="{{list.mobile}}"></orderchooseaddr>
<content num="{{list.num}}" price="{{list.goods_price}}" cprice="{{list.integral_money}}" number="{{list.order_sn}}" time="{{list.add_time}}" goods="{{list.goods_list}}" text="{{list.user_note}}"></content>
<content num="{{list.num}}" ziti="{{list.is_ziti}}" price="{{list.goods_price}}" cprice="{{list.integral_money}}" number="{{list.order_sn}}" time="{{list.add_time}}" goods="{{list.goods_list}}" text="{{list.user_note}}"></content>
</view>

View File

@ -1,4 +1,5 @@
{
"navigationBarTitleText": "订单详情",
"usingComponents": {
"content":"../components/particulars/content/index",
"orderchooseaddr":"../components/particulars/orderchooseaddr/index"

View File

@ -1,4 +1,4 @@
<view class="box">
<orderchooseaddr name="{{list.consignee}}" addr="{{list.address}}" phone="{{list.mobile}}"></orderchooseaddr>
<content num="{{list.num}}" price="{{list.goods_price}}" cprice="{{list.integral_money}}" number="{{list.order_sn}}" time="{{list.add_time}}" goods="{{list.goods_list}}" text="{{list.user_note}}"></content>
<content ziti="{{list.is_ziti}}" num="{{list.num}}" price="{{list.goods_price}}" cprice="{{list.integral_money}}" number="{{list.order_sn}}" time="{{list.add_time}}" goods="{{list.goods_list}}" text="{{list.user_note}}"></content>
</view>