|
@@ -57,6 +57,8 @@
|
|
|
class="action-btn recom">立即支付</button>
|
|
|
<button v-if="item._status._title == '待评价'" class="action-btn"
|
|
|
@click.stop="sy(item)">使用</button>
|
|
|
+ <button v-if="tabCurrentIndex == 1" class="action-btn"
|
|
|
+ @click.stop="openDh(item)">转赠</button>
|
|
|
<button v-if="item._status._title == '待收货'" @click.stop="orderTake(item, index)"
|
|
|
class="action-btn">确认收货</button>
|
|
|
<!-- <button v-if="item._status._title == '未发货' && item.is_gift != 1" class="action-btn"
|
|
@@ -68,12 +70,29 @@
|
|
|
</scroll-view>
|
|
|
</swiper-item>
|
|
|
</swiper>
|
|
|
+ <uni-popup ref="popupdh" class="agree-wrapper">
|
|
|
+ <view class="hx-wrapper">
|
|
|
+ <view class="hx-img">
|
|
|
+ <image src="../../static/img/hxbg.png" mode=""></image>
|
|
|
+ </view>
|
|
|
+ <view class="hx-body">
|
|
|
+ <view class="hx-title">赠送好友</view>
|
|
|
+ <input type="text" v-model="zzuid" placeholder="请输入好友UID" placeholder-class="hx-placeholder" />
|
|
|
+ <view class="hx-btn" @click.stop="gozz()">立即赠送</view>
|
|
|
+ </view>
|
|
|
+ <view class="hx-close" @click="closeDh()">
|
|
|
+ <image src="../../static/icon/close.png" mode=""></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
|
|
|
import empty from '@/components/empty';
|
|
|
+
|
|
|
+ import { gozz } from '@/api/shop.js'
|
|
|
import {
|
|
|
orderList,
|
|
|
orderCancel,
|
|
@@ -92,6 +111,10 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ zzitem: {},
|
|
|
+ zzuid: '',
|
|
|
+ zzcode: '',
|
|
|
+ dhing: false,
|
|
|
tabCurrentIndex: 0,
|
|
|
navList: [{
|
|
|
state: 0,
|
|
@@ -218,6 +241,42 @@
|
|
|
},
|
|
|
// #endif
|
|
|
methods: {
|
|
|
+ // 打开兑换弹窗
|
|
|
+ openDh(item) {
|
|
|
+ this.zzitem = item
|
|
|
+ this.zzcode = item.order_id
|
|
|
+ this.$refs.popupdh.open()
|
|
|
+ },
|
|
|
+ // 关闭兑换弹窗
|
|
|
+ closeDh() {
|
|
|
+ this.zzcode = ''
|
|
|
+ this.zzuid = ''
|
|
|
+ this.$refs.popupdh.close()
|
|
|
+ },
|
|
|
+ // 兑换
|
|
|
+ gozz() {
|
|
|
+ let obj = this
|
|
|
+ if (obj.dhing) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (obj.zzuid == '') {
|
|
|
+ return obj.$api.msg('请输入接收人UID')
|
|
|
+ }
|
|
|
+ obj.dhing = true
|
|
|
+ gozz({
|
|
|
+ order_id: obj.zzcode,
|
|
|
+ uid: obj.zzuid
|
|
|
+ }).then(res => {
|
|
|
+
|
|
|
+ let s = this.navList[obj.tabCurrentIndex].orderList.indexOf(obj.zzitem);
|
|
|
+ this.navList[obj.tabCurrentIndex].orderList.splice(s, 1);
|
|
|
+ obj.dhing = false
|
|
|
+ obj.closeDh()
|
|
|
+ obj.$api.showOk('赠送成功')
|
|
|
+ }).catch(err => {
|
|
|
+ obj.dhing = false
|
|
|
+ })
|
|
|
+ },
|
|
|
sy(e) {
|
|
|
console.log(e);
|
|
|
uni.navigateTo({
|
|
@@ -788,4 +847,78 @@
|
|
|
opacity: 0.2;
|
|
|
}
|
|
|
}
|
|
|
+ .hx-wrapper {
|
|
|
+ width: 536rpx;
|
|
|
+ height: 630rpx;
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ // background-color: #fff;
|
|
|
+ .hx-img {
|
|
|
+ width: 536rpx;
|
|
|
+ height: 281rpx;
|
|
|
+
|
|
|
+ image {
|
|
|
+ width: 536rpx;
|
|
|
+ height: 281rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .hx-close {
|
|
|
+ position: absolute;
|
|
|
+ left: 243rpx;
|
|
|
+ bottom: -80rpx;
|
|
|
+ width: 52rpx;
|
|
|
+ height: 52rpx;
|
|
|
+
|
|
|
+ image {
|
|
|
+ width: 52rpx;
|
|
|
+ height: 52rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .hx-body {
|
|
|
+ width: 536rpx;
|
|
|
+ height: 349rpx;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 0 0 10rpx 10rpx;
|
|
|
+
|
|
|
+ .hx-title {
|
|
|
+ width: 536rpx;
|
|
|
+ font-size: 36rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #333333;
|
|
|
+ line-height: 1;
|
|
|
+ padding-top: 42rpx;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ input {
|
|
|
+ width: 439rpx;
|
|
|
+ height: 68rpx;
|
|
|
+ background: #dbf3e9;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ margin: 39rpx auto 0;
|
|
|
+ padding-left: 26rpx;
|
|
|
+
|
|
|
+ .hx-placeholder {
|
|
|
+ font-size: 26rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #52c696;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .hx-btn {
|
|
|
+ margin: 44rpx auto 0;
|
|
|
+ width: 353rpx;
|
|
|
+ height: 71rpx;
|
|
|
+ background: #52c696;
|
|
|
+ border-radius: 34rpx;
|
|
|
+ font-size: 36rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #f8f9f9;
|
|
|
+ line-height: 71rpx;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|