|
@@ -28,11 +28,7 @@
|
|
|
|
|
|
<view class="coupon">
|
|
|
<view class="label"> 优惠券 </view>
|
|
|
- <view
|
|
|
- class="choose-coupon"
|
|
|
- :class="[payInfo.offset ? '' : 'none']"
|
|
|
- @click="choose"
|
|
|
- >
|
|
|
+ <view class="choose-coupon" :class="[payInfo.offset ? '' : 'none']" @click="choose">
|
|
|
<!-- {{payInfo.goodsCouponName}}-¥{{payInfo.offset}} -->
|
|
|
{{ payInfo.offset ? "-¥" + payInfo.offset : "暂无可用" }}
|
|
|
<image class="icon" src="../static/jiantou-icon.png" mode=""></image>
|
|
@@ -51,6 +47,15 @@
|
|
|
</view> -->
|
|
|
</view>
|
|
|
|
|
|
+ <view class="input-box">
|
|
|
+ <view class="label"> 备注 </view>
|
|
|
+ <view class="choose-coupon" @click="chooseRemark">
|
|
|
+ {{ info.extend.remark ? info.extend.remark : "请输入您的需求" }}
|
|
|
+ <image class="icon" src="../static/jiantou-icon.png" mode=""></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+
|
|
|
<view class="input-box" v-if="isVisual">
|
|
|
<view class="label"> 充值账号 </view>
|
|
|
<view class="value">
|
|
@@ -58,6 +63,15 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
+ <view class="input-box-address" @click="toMap()">
|
|
|
+ <view class="label"> 到店自取地址 </view>
|
|
|
+ <view class="value">
|
|
|
+ <!-- {{ info.address }} -->
|
|
|
+ 印象贵大文创店
|
|
|
+ </view>
|
|
|
+ <view class="label"> 贵州大学西校区西一区体育场楼下</view>
|
|
|
+ </view>
|
|
|
+
|
|
|
<view class="btn-box">
|
|
|
<view class="total-price">
|
|
|
<view class="label"> 合计: </view>
|
|
@@ -104,7 +118,8 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
query: {
|
|
|
- msgType: "wx.unifiedOrder",
|
|
|
+ // msgType: "wx.unifiedOrder",
|
|
|
+ msgType: "wx.miniPreOrder",
|
|
|
orderDesc: "测试",
|
|
|
orderNo: "",
|
|
|
subOpenId: "",
|
|
@@ -166,6 +181,29 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
+ chooseRemark() {
|
|
|
+ let that = this;
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "./remark",
|
|
|
+ success: function (res) {
|
|
|
+ // 通过eventChannel向被打开页面传送数据
|
|
|
+ res.eventChannel.emit("remark", that.info);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ toMap() {
|
|
|
+ uni.openLocation({
|
|
|
+ latitude: 26.4401,
|
|
|
+ longitude: 106.664,
|
|
|
+ name: "印象贵大文创店",
|
|
|
+ address: "贵州大学西校区西一区体育场楼下",
|
|
|
+ });
|
|
|
+ },
|
|
|
+ setRebackValue(value) {
|
|
|
+ // console.log('value', value);
|
|
|
+ this.info.extend.remark = value;
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
//创建订单
|
|
|
creat() {
|
|
|
if (this.loading) return;
|
|
@@ -180,11 +218,15 @@ export default {
|
|
|
let extend = {};
|
|
|
if (!this.info.extend) {
|
|
|
this.info.extend = JSON.stringify({ channel: "GZU" });
|
|
|
+ }else{
|
|
|
+ this.info.extend.channel = "GZU";
|
|
|
}
|
|
|
console.log("this.info.extend", this.info.extend);
|
|
|
try {
|
|
|
- if (JSON.parse(this.info.extend)) {
|
|
|
+ if(typeof this.info.extend == 'string'){
|
|
|
extend = this.info.extend;
|
|
|
+ }else{
|
|
|
+ extend = JSON.stringify(this.info.extend);
|
|
|
}
|
|
|
} catch (e) {
|
|
|
console.log("e", e);
|
|
@@ -219,7 +261,7 @@ export default {
|
|
|
|
|
|
creatPayOrder({
|
|
|
...this.query,
|
|
|
- subAppId: "wx3be1d6d84d46cdf7",
|
|
|
+ subAppId: "wxbc64403830bb13c5",
|
|
|
}).then((data) => {
|
|
|
that.payData = JSON.parse(data.content.miniPayRequest);
|
|
|
|
|
@@ -327,7 +369,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
- onReady() {},
|
|
|
+ onReady() { },
|
|
|
onLoad() {
|
|
|
let userInfo = JSON.parse(uni.getStorageSync("userInfo"));
|
|
|
this.query.userId = userInfo.userId;
|
|
@@ -336,6 +378,10 @@ export default {
|
|
|
eventChannel.on("pay", function (data) {
|
|
|
that.info = data;
|
|
|
try {
|
|
|
+ // 初始化备注
|
|
|
+ that.info.extend = {
|
|
|
+ remark:''
|
|
|
+ };
|
|
|
let extend = JSON.parse(that.info.extend);
|
|
|
if (extend.account) {
|
|
|
that.isVisual = true;
|
|
@@ -344,7 +390,8 @@ export default {
|
|
|
} catch (e) {
|
|
|
//TODO handle the exception
|
|
|
}
|
|
|
- console.log("data", data);
|
|
|
+ console.log("data", data,that.info);
|
|
|
+
|
|
|
that.calculate(that.info.goodsId, that.info.shopId);
|
|
|
});
|
|
|
},
|
|
@@ -430,7 +477,7 @@ export default {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
|
- border-bottom: 2rpx dashed #f3f3f3;
|
|
|
+ // border-bottom: 2rpx dashed #f3f3f3;
|
|
|
padding: 28rpx 0;
|
|
|
|
|
|
.label {
|
|
@@ -441,6 +488,7 @@ export default {
|
|
|
.choose-coupon.none {
|
|
|
color: #aaaaaa;
|
|
|
}
|
|
|
+
|
|
|
.choose-coupon {
|
|
|
color: #ff4848;
|
|
|
font-size: 28rpx;
|
|
@@ -493,6 +541,7 @@ export default {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
|
+
|
|
|
.label {
|
|
|
color: #222;
|
|
|
font-size: 28rpx;
|
|
@@ -504,6 +553,27 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ .input-box-address {
|
|
|
+ margin: 20rpx 30rpx;
|
|
|
+ padding: 28rpx 24rpx;
|
|
|
+ background: #ffffff;
|
|
|
+ border-radius: 16rpx 16rpx 16rpx 16rpx;
|
|
|
+ // display: flex;
|
|
|
+ // align-items: center;
|
|
|
+ // justify-content: space-between;
|
|
|
+
|
|
|
+ .value {
|
|
|
+ color: #222;
|
|
|
+ font-size: 28rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .label {
|
|
|
+ font-size: 28rpx;
|
|
|
+ margin: 10rpx 0;
|
|
|
+ color: #aaaaaa;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.btn-box {
|
|
|
position: fixed;
|
|
|
bottom: 0%;
|
|
@@ -549,4 +619,23 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.label {
|
|
|
+ color: #222222;
|
|
|
+ font-size: 28rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.choose-coupon {
|
|
|
+ color: #aaaaaa;
|
|
|
+ font-size: 28rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .icon {
|
|
|
+ width: 28rpx;
|
|
|
+ height: 28rpx;
|
|
|
+ display: block;
|
|
|
+ margin-left: 10rpx;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|