|
@@ -20,7 +20,10 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="info">
|
|
<view class="info">
|
|
|
<view class="title">
|
|
<view class="title">
|
|
|
- <view class="name">{{ orderData.product.product_name }}</view>
|
|
|
|
|
|
|
+ <view class="name" v-if="orderData.product.is_new==1">
|
|
|
|
|
+ {{orderData.product.price}}元代{{orderData.product.line_price}}元商场权益券{{orderData.product.product_name}}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="name" v-else>{{ orderData.product.product_name }}</view>
|
|
|
<view class="num">x{{ orderData.number }}</view>
|
|
<view class="num">x{{ orderData.number }}</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="tags">
|
|
<view class="tags">
|
|
@@ -32,17 +35,39 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="order-info">
|
|
<view class="order-info">
|
|
|
- <view class="title-h">完善信息</view>
|
|
|
|
|
|
|
+ <view class="title-h">意向商品<text>(可选{{orderData.number}}份)</text></view>
|
|
|
|
|
+ <view class="goods-item" v-for="(item,indx) in doneGoods" :key="indx">
|
|
|
|
|
+ <view class="item-goods" style="padding: 10rpx;background-color: #f8f8f8;">
|
|
|
|
|
+ <view class="item-goods-body">
|
|
|
|
|
+ <view class="image">
|
|
|
|
|
+ <image :src="item.image"></image>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="info">
|
|
|
|
|
+ <view class="title">
|
|
|
|
|
+ <view class="name">{{ item.title }}</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="tags">
|
|
|
|
|
+ <view></view>
|
|
|
|
|
+ <view class="price">x{{ item.number }}</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="goods-item-check" @click="chooseGoods">{{doneGoods.length == 0 ? '请选择': '更换其他'}}</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="order-info">
|
|
|
|
|
+ <view class="title-h">会员信息</view>
|
|
|
<view class="form-feedbak">
|
|
<view class="form-feedbak">
|
|
|
<view class="title"><text>*</text>姓名</view>
|
|
<view class="title"><text>*</text>姓名</view>
|
|
|
<view class="form-textarea">
|
|
<view class="form-textarea">
|
|
|
- <input :value="addressForm.nickname" data-field="nickname" placeholder="请输入" class="u-input" />
|
|
|
|
|
|
|
+ <input v-model="addressForm.nickname" data-field="nickname" placeholder="请输入" class="u-input" />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="form-feedbak">
|
|
<view class="form-feedbak">
|
|
|
<view class="title"><text>*</text>手机号码</view>
|
|
<view class="title"><text>*</text>手机号码</view>
|
|
|
<view class="form-textarea">
|
|
<view class="form-textarea">
|
|
|
- <input :value="addressForm.mobile" data-field="mobile" placeholder="请输入" class="u-input" />
|
|
|
|
|
|
|
+ <input v-model="addressForm.mobile" data-field="mobile" placeholder="请输入" class="u-input" />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="form-feedbak">
|
|
<view class="form-feedbak">
|
|
@@ -54,7 +79,7 @@
|
|
|
<view class="form-feedbak">
|
|
<view class="form-feedbak">
|
|
|
<view class="title"><text>*</text>详细地址</view>
|
|
<view class="title"><text>*</text>详细地址</view>
|
|
|
<view class="form-textarea">
|
|
<view class="form-textarea">
|
|
|
- <input :value="addressForm.address" data-field="address" placeholder="请输入" class="u-textarea" />
|
|
|
|
|
|
|
+ <input v-model="addressForm.address" data-field="address" placeholder="请输入" class="u-textarea" />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -63,9 +88,8 @@
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
<view class="footer">
|
|
<view class="footer">
|
|
|
<view class="footer-op">
|
|
<view class="footer-op">
|
|
|
- <view class="footer-left"></view>
|
|
|
|
|
<view class="footer-right">
|
|
<view class="footer-right">
|
|
|
- <view class="btn">再次购买</view>
|
|
|
|
|
|
|
+ <button :loading="isSubmit" :disabled="isSubmit" class="btn full" @click="submitOrder">提交</button>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="footer-safe"></view>
|
|
<view class="footer-safe"></view>
|
|
@@ -101,26 +125,36 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="address-footer">
|
|
<view class="address-footer">
|
|
|
<view class="footer-btn" @click="closeOrder">取消</view>
|
|
<view class="footer-btn" @click="closeOrder">取消</view>
|
|
|
- <view class="footer-btn full">确定</view>
|
|
|
|
|
|
|
+ <view class="footer-btn full" @click="checkAddress">确定</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</uni-popup>
|
|
</uni-popup>
|
|
|
|
|
+
|
|
|
|
|
+ <goodsDialog ref="goodsDialog" @send="sendGoods"></goodsDialog>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
var app;
|
|
var app;
|
|
|
-export default {
|
|
|
|
|
|
|
+import goodsDialog from '@/components/chat/goods';
|
|
|
|
|
+import form from "@/static/js/form.js";
|
|
|
|
|
+export default {
|
|
|
|
|
+ components: {
|
|
|
|
|
+ goodsDialog
|
|
|
|
|
+ },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ eventChannel:null,
|
|
|
optionData:null,
|
|
optionData:null,
|
|
|
orderData:null,
|
|
orderData:null,
|
|
|
loading:false,
|
|
loading:false,
|
|
|
cityData:[],
|
|
cityData:[],
|
|
|
addressForm:{},
|
|
addressForm:{},
|
|
|
|
|
+ isSubmit:false,
|
|
|
addressData:{
|
|
addressData:{
|
|
|
- index:0,
|
|
|
|
|
- name:"请选择"
|
|
|
|
|
|
|
+ name:"请选择",
|
|
|
|
|
+ hide:null,
|
|
|
|
|
+ list:[]
|
|
|
},
|
|
},
|
|
|
fristData:{
|
|
fristData:{
|
|
|
index:null,
|
|
index:null,
|
|
@@ -137,14 +171,60 @@ export default {
|
|
|
name:"",
|
|
name:"",
|
|
|
list:[]
|
|
list:[]
|
|
|
},
|
|
},
|
|
|
|
|
+ doneGoods:[]
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
|
app = this;
|
|
app = this;
|
|
|
app.optionData = options;
|
|
app.optionData = options;
|
|
|
|
|
+ app.eventChannel = this.getOpenerEventChannel();
|
|
|
this.getOrder();
|
|
this.getOrder();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ async submitOrder(){
|
|
|
|
|
+ if (app.doneGoods.length == 0) return app.$dialog.showSuccess("请选择意向商品");
|
|
|
|
|
+ var formData = this.addressForm;
|
|
|
|
|
+ var validation = form.validation(formData,[
|
|
|
|
|
+ {name:"nickname",rule:["required"],msg:["请输入姓名"]},
|
|
|
|
|
+ {name:"mobile",rule:["required","isMobile"],msg:["请填写手机号码","手机号码格式错误"]},
|
|
|
|
|
+ {name:"address",rule:["required"],msg:["请输入"]},
|
|
|
|
|
+ ]);
|
|
|
|
|
+ if(validation){
|
|
|
|
|
+ this.$dialog.showSuccess(validation);
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!app.addressData.hide) return app.$dialog.showSuccess("请选择地区");
|
|
|
|
|
+ formData.goods = JSON.stringify(app.doneGoods);
|
|
|
|
|
+ formData.city = JSON.stringify(app.addressData)
|
|
|
|
|
+ formData.order = app.optionData.order
|
|
|
|
|
+ app.isSubmit = true;
|
|
|
|
|
+ var resp = await app.$api.order.address.post(formData);
|
|
|
|
|
+ app.isSubmit = false;
|
|
|
|
|
+ if (resp.code !== 1) return app.$dialog.showSuccess(resp.msg);
|
|
|
|
|
+ app.$dialog.showSuccess(resp.msg);
|
|
|
|
|
+ app.eventChannel.emit('acceptData', { msg: '会员信息已完善' });
|
|
|
|
|
+ uni.navigateBack();
|
|
|
|
|
+ },
|
|
|
|
|
+ chooseGoods(){
|
|
|
|
|
+ this.$nextTick(()=>{
|
|
|
|
|
+ this.$refs.goodsDialog.open().setData({"order":app.optionData.order,"num":app.orderData.number});
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ sendGoods(data){
|
|
|
|
|
+ app.doneGoods = data;
|
|
|
|
|
+ },
|
|
|
|
|
+ checkAddress(){
|
|
|
|
|
+ if (!app.fristData.index) return this.$dialog.showSuccess("请完善地区信息!");
|
|
|
|
|
+ if (!app.secondData.index) return this.$dialog.showSuccess("请完善地区信息~");
|
|
|
|
|
+ if (!app.threeData.index) return this.$dialog.showSuccess("请完善地区信息");
|
|
|
|
|
+ var fristData = app.cityData[app.fristData.index];
|
|
|
|
|
+ var secondData = fristData.children[app.secondData.index];
|
|
|
|
|
+ var threeData = secondData.children[app.threeData.index];
|
|
|
|
|
+ app.addressData.name = fristData.text+"/"+secondData.text+"/"+threeData.text
|
|
|
|
|
+ app.addressData.hide = fristData.text+secondData.text+threeData.text
|
|
|
|
|
+ app.addressData.list = [fristData.value,secondData.value,threeData.value]
|
|
|
|
|
+ app.$refs.addressPop.close()
|
|
|
|
|
+ },
|
|
|
addClick(indx,type) {
|
|
addClick(indx,type) {
|
|
|
if (type == 1) {
|
|
if (type == 1) {
|
|
|
app.fristData.index = indx;
|
|
app.fristData.index = indx;
|
|
@@ -216,6 +296,16 @@ export default {
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
|
|
+.goods-item-check{
|
|
|
|
|
+ margin: 20rpx;
|
|
|
|
|
+ border: 2rpx solid $main-text-color;
|
|
|
|
|
+ height: 80rpx;
|
|
|
|
|
+ line-height: 80rpx;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
|
+ color: $main-text-color;
|
|
|
|
|
+ border-radius: 10rpx;
|
|
|
|
|
+}
|
|
|
.address-pop{
|
|
.address-pop{
|
|
|
.address-check{
|
|
.address-check{
|
|
|
display: flex;
|
|
display: flex;
|
|
@@ -315,7 +405,15 @@ export default {
|
|
|
.order-info{
|
|
.order-info{
|
|
|
border-radius: 20rpx;
|
|
border-radius: 20rpx;
|
|
|
background-color: #fff;padding: 20upx;margin-top: 20upx;
|
|
background-color: #fff;padding: 20upx;margin-top: 20upx;
|
|
|
- .title-h{font-size: 32upx;color: #333;font-weight: bold;margin-bottom: 20rpx;}
|
|
|
|
|
|
|
+ .title-h{
|
|
|
|
|
+ font-size: 32upx;color: #333;font-weight: bold;margin-bottom: 20rpx;
|
|
|
|
|
+ text {
|
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
|
+ color: #666;
|
|
|
|
|
+ font-weight: normal;
|
|
|
|
|
+ margin-left: 20rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
.item-goods{
|
|
.item-goods{
|
|
@@ -403,7 +501,9 @@ export default {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
gap: 20rpx;
|
|
gap: 20rpx;
|
|
|
|
|
+ flex: 1;
|
|
|
.btn{
|
|
.btn{
|
|
|
|
|
+ width: 100%;
|
|
|
font-size: 28rpx;
|
|
font-size: 28rpx;
|
|
|
height: 80upx;
|
|
height: 80upx;
|
|
|
border-radius: 10upx;
|
|
border-radius: 10upx;
|