|
@@ -69,8 +69,10 @@
|
|
|
>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <button class="btn1" open-type="share">确认分享</button>
|
|
|
- <!-- <button class="btn1" @click="sureShare()">确认分享</button> -->
|
|
|
+ <button class="btn1" open-type="share" v-if="shareFlag">
|
|
|
+ 确认分享
|
|
|
+ </button>
|
|
|
+ <button class="btn1" v-else>暂不可分享</button>
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -82,19 +84,34 @@ export default {
|
|
|
messageFlag: true,
|
|
|
serviceNumberFlag: true,
|
|
|
voipFlag: true,
|
|
|
+ shareFlag: false,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
smChange() {
|
|
|
this.messageFlag = !this.messageFlag;
|
|
|
+ this.shareUserLink("权限修改成功");
|
|
|
},
|
|
|
snChange() {
|
|
|
this.serviceNumberFlag = !this.serviceNumberFlag;
|
|
|
+ this.shareUserLink("权限修改成功");
|
|
|
},
|
|
|
+
|
|
|
vfChange() {
|
|
|
this.voipFlag = !this.voipFlag;
|
|
|
+ this.shareUserLink("权限修改成功");
|
|
|
},
|
|
|
onShareAppMessage() {
|
|
|
+ return {
|
|
|
+ title: "好友向您分享了一台设备",
|
|
|
+ path:
|
|
|
+ "/pagesA/sharePages/sharePages?phone=" +
|
|
|
+ this.phone +
|
|
|
+ "&devInfo=" +
|
|
|
+ JSON.stringify(this.devInfo),
|
|
|
+ };
|
|
|
+ },
|
|
|
+ shareUserLink(itemTitle) {
|
|
|
let shareParam = {
|
|
|
devId: this.devInfo.devId,
|
|
|
sharerUserId: uni.getStorageSync("userId"),
|
|
@@ -113,19 +130,11 @@ export default {
|
|
|
.then((res) => {
|
|
|
if (res.statusCode == 200) {
|
|
|
uni.showToast({
|
|
|
- title: "分享成功",
|
|
|
- icon: "success",
|
|
|
+ title: itemTitle,
|
|
|
+ icon: "none",
|
|
|
duration: 1500,
|
|
|
});
|
|
|
- return {
|
|
|
- title: "好友向您分享了一台设备",
|
|
|
- path:
|
|
|
- "/pagesA/sharePages/sharePages?phone=" +
|
|
|
- this.phone +
|
|
|
- "&devInfo=" +
|
|
|
- JSON.stringify(this.devInfo),
|
|
|
- miniprogramType: 2,
|
|
|
- };
|
|
|
+ this.shareFlag = true;
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
title: res.data.message,
|
|
@@ -139,6 +148,11 @@ export default {
|
|
|
onLoad(options) {
|
|
|
this.devInfo = JSON.parse(options.devInfo);
|
|
|
},
|
|
|
+ onShow() {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.shareUserLink("分享链接创建成功");
|
|
|
+ }, 500);
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|