新增病种详情分享图片生成、修改优惠券组的样式

master
chen 2022-05-27 19:02:13 +08:00
parent c1a53d9540
commit b255ef510d
19 changed files with 90 additions and 34 deletions

View File

@ -4,7 +4,10 @@
<status-nav :titleVal="title" :statusTitle="true"></status-nav> <status-nav :titleVal="title" :statusTitle="true"></status-nav>
<!-- 列表 --> <!-- 列表 -->
<view :style="{paddingTop: (statusHeight+15)+'px'}" class="pad-zy32"> <view :style="{paddingTop: (statusHeight+15)+'px'}" class="pad-zy32">
<view class="pad-x30"> <view class="fon28" style="color: #1A1A1A; line-height: 40rpx;">
<rich-text :nodes="richText"></rich-text>
</view>
<!-- <view class="pad-x30">
<view v-if="dataList.length!=0" class="mar-x20 animated fadeInLeft" v-for="(item,index) in dataList" :key="index"> <view v-if="dataList.length!=0" class="mar-x20 animated fadeInLeft" v-for="(item,index) in dataList" :key="index">
<view style="height: 200rpx;" class="disjbac posir"> <view style="height: 200rpx;" class="disjbac posir">
<view class="disjcac fc recerve-left" style="width: 218rpx;height: 200rpx;flex-shrink: 0;text-align: center;color: #FFFFFF;"> <view class="disjcac fc recerve-left" style="width: 218rpx;height: 200rpx;flex-shrink: 0;text-align: center;color: #FFFFFF;">
@ -22,13 +25,15 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view> -->
<view class="tcenter bold fon36 pad-x20">详情</view>
<view class="fon28" style="color: #1A1A1A; line-height: 40rpx;">
<rich-text :nodes="richText"></rich-text>
</view>
<view class="posixzy bacf pad-sx25"> <view class="posixzy bacf pad-sx25">
<view @tap="allReceive" class="fon30 radius20 tc colf bold" style="margin: 0 83rpx;height: 90rpx;line-height: 90rpx;" :style="{background:publicColor}">一键领取</view> <view @tap="allReceive" class="fon30 radius20 tc colf bold" style="margin: 0 83rpx;height: 90rpx;line-height: 90rpx;" :style="{background:publicColor}">{{['一键领取','立即使用'][dataList[0].get]}}</view>
</view>
</view>
<view class="disjcac" v-if="ifLing" style="position: fixed;top: 0;left: 0;bottom: 0;right: 0;background-color: rgba(0, 0, 0, .7);z-index: 2;padding: 0 100rpx;">
<view class="tcenter radius30 bacf width100 pad-sx50">
<view class="bold pad-s30" style="font-size: 48rpx;">恭喜您领取成功</view>
<view @tap="allReceive" class="disjcac fon38" style="width: 426rpx;height: 80rpx;border-radius: 20rpx;color: #FFFFFF;margin: 0 auto;margin-top: 100rpx;margin-bottom: 10rpx;" :style="{backgroundColor:publicColor}">立即使用</view>
</view> </view>
</view> </view>
<!-- 用户信息授权手机号授权 --> <!-- 用户信息授权手机号授权 -->
@ -47,7 +52,8 @@
sizeq: 162, sizeq: 162,
title:'优惠券组', title:'优惠券组',
richText:'', richText:'',
groupId:'' groupId:'',
ifLing:false
} }
}, },
computed:{ computed:{
@ -59,6 +65,13 @@
return this.$store.state.statusHeight return this.$store.state.statusHeight
} }
}, },
onShareAppMessage() {
var shareObj = {
title: `${ya.detailObj.title}`, // (slogan)
path: `/pagesB/couponGroup/couponGroup?group_id=${this.groupId}&share_id=${uni.getStorageSync('userId')}&invite_code=${uni.getStorageSync('invite_code')}`, // /
imageUrl: `` //PNGJPG imageUrl 使 5:4
};
},
onLoad(op) { onLoad(op) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkAllList(op.group_id); this.checkAllList(op.group_id);
@ -69,15 +82,21 @@
}, },
methods: { methods: {
allReceive(){ allReceive(){
console.log(this.groupId); if(this.dataList[0].get) {
uni.reLaunch({
url:'/pages/tabbar/pagehome/pagehome'
})
} else {
this.$requst.post('user/get-coupon-group',{group_id:this.groupId}).then(res=>{ this.$requst.post('user/get-coupon-group',{group_id:this.groupId}).then(res=>{
if(res.code==0){ if(res.code==0){
this.$toolAll.tools.showToast('领取成功(*^▽^*)'); // this.$toolAll.tools.showToast('(*^^*)');
this.ifLing = true;
this.checkAllList(this.groupId); this.checkAllList(this.groupId);
} else { } else {
this.$toolAll.tools.showToast(res.msg); this.$toolAll.tools.showToast(res.msg);
} }
}) })
}
}, },
checkAllList(group_id){// checkAllList(group_id){//
this.$requst.post('user/get-coupon-group-info',{group_id}).then(res=>{ this.$requst.post('user/get-coupon-group-info',{group_id}).then(res=>{

View File

@ -91,6 +91,10 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 分享 -->
<view @tap="shareImgEv" class="detail-cart-box" style="display: flex;justify-content: center;align-items: center;width: 112rpx;height: 112rpx;border-radius: 100%;background-color: rgba(0,0,0,.5);bottom: 160rpx;color: #FFFFFF;">
分享
</view>
<!-- 返回顶部 --> <!-- 返回顶部 -->
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> --> <!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
<!-- 用户信息授权手机号授权 --> <!-- 用户信息授权手机号授权 -->
@ -111,6 +115,7 @@
collectionEV, collectionEV,
cancleCollectionEV cancleCollectionEV
} from '@/jsFile/publicAPI.js'; } from '@/jsFile/publicAPI.js';
import { base64ToPath } from '@/jsFile/base64-src.js';
export default { export default {
components: { components: {
listDoctor, listDoctor,
@ -157,6 +162,7 @@
contentVal:'', contentVal:'',
newHeight:'450', newHeight:'450',
ifSwiper:0,//swiper ifSwiper:0,//swiper
shareFlag:true,
} }
}, },
computed: { computed: {
@ -223,6 +229,37 @@
} }
}, },
methods: { methods: {
//
shareImgEv(){
this.$toolAll.tools.showToast('分享图生成中...','none',10000);
if(this.shareFlag){
this.shareFlag = false;
this.$requst.post('archives/share',{id:this.detailObj.id}).then(res=>{
base64ToPath(res.data.share_img).then(path=>{
uni.hideToast();
this.$toolAll.tools.showToast('正在调起分享...');
wx.showShareImageMenu({
path: path,
success:(res=>{
this.shareFlag = true;
this.$requst.post('user/record', {
type: 'content',
action: 'share',
id: this.detailObj.id
}).then(res => {
console.log('分享成功:', res);
}, error => {})
// tools.js
this.$toolAll.tools.plantPoint(4);
}),
fail:(err=>{
this.shareFlag = true;
})
})
})
})
} else {this.$toolAll.tools.showToast('请勿重复点击');}
},
// //
gopage(index){ gopage(index){
uni.navigateTo({ uni.navigateTo({

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long