|
@@ -83,7 +83,10 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="list-cell-time">{{ coupon.startDate }} - {{ coupon.endDate }}</view>
|
|
|
+ <view class="list-cell-time">{{ coupon.startDate }} - {{ coupon.endDate }}</view>
|
|
|
+ <button open-type="share" class="list-cell-share" :data-coupon="coupon">
|
|
|
+ <text class="iconfont icon-fenxiang"></text>
|
|
|
+ </button>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!--加载loadding-->
|
|
@@ -112,7 +115,8 @@
|
|
|
import { mapState, mapMutations } from 'vuex'
|
|
|
import authorize from '@/common/config/authorize.js'
|
|
|
import couponTabs from '@/components/cm-module/coupon/tui-tabs.vue'
|
|
|
-import payMixins from '@/mixins/payMixins.js'
|
|
|
+import payMixins from '@/mixins/payMixins.js'
|
|
|
+import { COUPON_TEXT_MAP } from '@/utils/coupon.share.js'
|
|
|
export default {
|
|
|
mixins: [payMixins],
|
|
|
components: {
|
|
@@ -122,7 +126,7 @@ export default {
|
|
|
return {
|
|
|
StaticUrl: this.$Static,
|
|
|
isIphoneX: this.$store.state.isIphoneX,
|
|
|
- userIdentity: 0,
|
|
|
+ userIdentity: 0,
|
|
|
listQuery: {
|
|
|
userId: 0,
|
|
|
pageNum: 1,
|
|
@@ -417,7 +421,22 @@ export default {
|
|
|
navigator(url) {
|
|
|
this.$api.navigateTo(url)
|
|
|
}
|
|
|
- },
|
|
|
+ },
|
|
|
+ onShareAppMessage(res) {
|
|
|
+ //分享购买优惠券
|
|
|
+ const coupon = res.target.dataset.coupon
|
|
|
+ if (res.from === 'button') {
|
|
|
+ const randomIndex = Math.floor(Math.random() * COUPON_TEXT_MAP.length)
|
|
|
+ const shareTitle = coupon.moneyCouponFlag === 1 ?
|
|
|
+ `${coupon.moneyCouponPrice}抵${coupon.couponAmount},限时优惠券等您抢购~` :
|
|
|
+ COUPON_TEXT_MAP[randomIndex]
|
|
|
+ return {
|
|
|
+ title: shareTitle,
|
|
|
+ path: `pages/user/coupon/coupon-details?couponId=${coupon.couponId}&shareUserId=${this.listQuery.userId}`,
|
|
|
+ imageUrl: 'https://static.caimei365.com/app/img/icon/icon-shareCoupon@2x.png'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
onPullDownRefresh() {
|
|
|
setTimeout(() => {
|
|
|
this.QueryCouponList()
|
|
@@ -494,7 +513,27 @@ page {
|
|
|
height: 100%;
|
|
|
box-sizing: border-box;
|
|
|
padding: 20rpx 24rpx 0 24rpx;
|
|
|
- float: right;
|
|
|
+ float: right;
|
|
|
+ position: relative;
|
|
|
+ .list-cell-share{
|
|
|
+ width: 60rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ line-height: 60rpx;
|
|
|
+ text-align: center;
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: block;
|
|
|
+ background: transparent;
|
|
|
+ border-radius: 0;
|
|
|
+ border: 0;
|
|
|
+ margin: 0;
|
|
|
+ .iconfont{
|
|
|
+ font-size: 40rpx;
|
|
|
+ color: #07c160;
|
|
|
+ }
|
|
|
+ }
|
|
|
.list-cell-top {
|
|
|
width: 100%;
|
|
|
height: 121rpx;
|
|
@@ -543,7 +582,7 @@ page {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
box-sizing: border-box;
|
|
|
- padding-top: 28rpx;
|
|
|
+ padding-top: 48rpx;
|
|
|
.icon-used-text {
|
|
|
width: 100%;
|
|
|
text-align: center;
|