|
@@ -64,7 +64,10 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="24" class="submit">
|
|
|
- <el-col :span="20" class="input">
|
|
|
+ <el-col :span="2" class="supporticon">
|
|
|
+ <van-icon name="gold-coin" size="30" color="#F56C6C" @click="supportShow = true" />
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="18" class="input">
|
|
|
<el-input type="textarea" maxlength="5000" :rows="1" v-model="content"></el-input>
|
|
|
</el-col>
|
|
|
<el-col :span="4" class="btn">
|
|
@@ -126,6 +129,19 @@
|
|
|
<van-button color="linear-gradient(to right, #4bb0ff, #6149f6)" @click="submitQuest">提交</van-button>
|
|
|
</van-col>
|
|
|
</van-popup>
|
|
|
+ <van-action-sheet v-model="supportShow" title="请选择打赏金额">
|
|
|
+ <van-col :span="24" class="supportmoney">
|
|
|
+ <van-radio-group v-model="order.money" direction="horizontal">
|
|
|
+ <van-radio name="0.01">0.01</van-radio>
|
|
|
+ <van-radio name="1.88">1.88</van-radio>
|
|
|
+ <van-radio name="8.88">8.88</van-radio>
|
|
|
+ <van-radio name="88.88">88.88</van-radio>
|
|
|
+ </van-radio-group>
|
|
|
+ </van-col>
|
|
|
+ <van-col :span="24" class="supportbtn">
|
|
|
+ <van-button icon="star-o" type="primary" @click="toSupport">按钮</van-button>
|
|
|
+ </van-col>
|
|
|
+ </van-action-sheet>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -145,6 +161,7 @@ const { mapActions: gensign } = createNamespacedHelpers('gensign');
|
|
|
const { mapActions: room } = createNamespacedHelpers('room');
|
|
|
const { mapActions: quest } = createNamespacedHelpers('quest');
|
|
|
const { mapActions: chat } = createNamespacedHelpers('chat');
|
|
|
+const { mapActions: mapWeiXin } = createNamespacedHelpers('weixin');
|
|
|
export default {
|
|
|
name: 'roomsDetail',
|
|
|
props: {},
|
|
@@ -201,6 +218,8 @@ export default {
|
|
|
stremOtherlist: [],
|
|
|
swichzjrid: '',
|
|
|
swichzjrstatus: false,
|
|
|
+ order: {},
|
|
|
+ supportShow: false,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -226,6 +245,7 @@ export default {
|
|
|
...chat(['query', 'create']),
|
|
|
...quest(['questfetch']),
|
|
|
...uploadquestion({ upcreate: 'create', upquery: 'query' }),
|
|
|
+ ...mapWeiXin(['support']),
|
|
|
reviewVideo(newstrem, newid, oldstrem, oldid) {
|
|
|
oldstrem.stop();
|
|
|
newstrem.stop();
|
|
@@ -943,6 +963,53 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ async toSupport() {
|
|
|
+ this.$message({
|
|
|
+ message: '功能完善中',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ // let no = `support${this.getOrderNo()}`;
|
|
|
+ // this.order.orderno = no;
|
|
|
+ // const res = await this.support({ ...this.order, openid: this.user.openid });
|
|
|
+ // if (res.errcode === 0) {
|
|
|
+ // this.toPay(res.data);
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ getOrderNo() {
|
|
|
+ let y = new Date().getFullYear();
|
|
|
+ let m = new Date().getMonth() + 1;
|
|
|
+ m = m < 10 ? '0' + m : m;
|
|
|
+ let d = new Date().getDate();
|
|
|
+ d = d < 10 ? '0' + d : d;
|
|
|
+ let h = new Date().getHours();
|
|
|
+ h = h < 10 ? '0' + h : h;
|
|
|
+ let minute = new Date().getMinutes();
|
|
|
+ minute = minute < 10 ? '0' + minute : minute;
|
|
|
+ let second = new Date().getSeconds();
|
|
|
+ second = second < 10 ? '0' + second : second;
|
|
|
+ return y + m + d + h + minute + second;
|
|
|
+ },
|
|
|
+ async toPay(res) {
|
|
|
+ let data = {
|
|
|
+ appId: res.appId,
|
|
|
+ timeStamp: res.timeStamp,
|
|
|
+ nonceStr: res.nonceStr,
|
|
|
+ package: `prepay_id=${res.prepayId}`,
|
|
|
+ signType: 'MD5',
|
|
|
+ paySign: res.sign,
|
|
|
+ };
|
|
|
+ // eslint-disable-next-line no-undef
|
|
|
+ WeixinJSBridge.invoke('getBrandWCPayRequest', data, async res => {
|
|
|
+ if (res.err_msg == 'get_brand_wcpay_request:ok') {
|
|
|
+ const res = await this.pay({ doctorid: this.id, patientid: this.user.id, ...this.order });
|
|
|
+ if (res.errcode === 0) this.$toast({ message: '支持成功', type: 'success' });
|
|
|
+ else this.$toast({ message: '支持失败', type: 'fail' });
|
|
|
+ } else {
|
|
|
+ console.log(`pay fail`);
|
|
|
+ console.log(res);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
@@ -1081,4 +1148,13 @@ export default {
|
|
|
border-radius: 5px;
|
|
|
}
|
|
|
}
|
|
|
+.supportmoney {
|
|
|
+ padding: 20px 15px;
|
|
|
+ .van-radio {
|
|
|
+ padding: 20px 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+.supportbtn {
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
</style>
|