This commit is contained in:
魏啾
2024-11-23 13:55:01 +08:00
parent 2147f86b93
commit bfd37cddf5
18 changed files with 1237 additions and 350 deletions

View File

@@ -94,7 +94,7 @@
<u-icon name="weixin-fill" color="#04be02" size="28"></u-icon>
微信抬头一键导入
</view>
<view class="content_bottom" @click="saveMerchantBaseInfo">确定</view>
<view class="content_bottom" @click="requestSubscribeMessage">确定</view>
</view>
</template>
@@ -334,7 +334,99 @@
}
});
},
async saveMerchantBaseInfo() {
requestSubscribeMessage() {
var this_ = this
var tmplIds = 'LQ4X2dgvpxC6iuZhbxv8qtqVWT9_DFEBPxu-PmggjfY'
uni.getSetting({
withSubscriptions: true,
success(res) {
// 调起授权界面弹窗
if (res.subscriptionsSetting.mainSwitch) { // 用户打开了订阅消息总开关
if (res.subscriptionsSetting.itemSettings !=
null) { // 用户同意总是保持是否推送消息的选择, 这里表示以后不会再拉起推送消息的授权
let moIdState = res.subscriptionsSetting.itemSettings[tmplIds]; // 用户同意的消息模板id
if (moIdState === 'accept') {
uni.requestSubscribeMessage({ // 调起消息订阅界面
tmplIds: [tmplIds],
success(res) {
if (res[tmplIds] == 'accept') {
this_.overlayshowclick(1)
} else if (res[tmplIds] == 'reject') {
this_.overlayshowclick(0)
} else if (res[tmplIds] == 'ban') {
this_.overlayshowclick(0)
} else if (res[tmplIds] == 'accept') {
this_.overlayshowclick(0)
} else {
this_.overlayshowclick(0)
}
},
fail(er) {
this_.overlayshowclick(0)
console.log(er);
}
})
} else if (moIdState === 'reject') {
console.log("拒绝消息推送");
this_.overlayshowclick(0)
} else if (moIdState === 'ban') {
console.log("已被后台封禁");
this_.overlayshowclick(0)
}
} else {
// 当用户没有点击 ’总是保持以上选择,不再询问‘ 按钮。那每次执到这都会拉起授权弹窗
uni.showModal({
title: '提示',
content: '请授权开通服务通知',
showCancel: true,
success: function(ress) {
if (ress.confirm) {
// console.log('用户点击确定')
uni.requestSubscribeMessage({ // 调起消息订阅界面
tmplIds: [tmplIds],
success(res) {
if (res[tmplIds] == 'accept') {
this_.overlayshowclick(1)
} else if (res[tmplIds] == 'reject') {
this_.overlayshowclick(0)
} else if (res[tmplIds] == 'ban') {
this_.overlayshowclick(0)
} else if (res[tmplIds] == 'accept') {
this_.overlayshowclick(0)
} else {
this_.overlayshowclick(0)
}
},
fail(er) {
this_.overlayshowclick(0)
console.log(er);
}
})
} else if (ress.cancel) {
this_.overlayshowclick(0)
}
}
})
}
} else {
this_.overlayshowclick(0)
}
}
})
},
async overlayshowclick(e) {
try {
if (e == 1) {
await this.api.userminidymessage({
open_id: this.form.open_id,
})
}
} catch (e) {
//TODO handle the exception
}
if (this.form.user_name == null || this.form.user_name == '') {
uni.showToast({
title: '请输入名称',

View File

@@ -64,7 +64,7 @@
拒绝理由:{{form.no|| '无'}}</view>
</view>
</view>
<view class="content_bottom" @click="saveMerchantBaseInfo">
<view class="content_bottom" @click="requestSubscribeMessage">
确定
</view>
</view>
@@ -204,7 +204,99 @@
}
});
},
async saveMerchantBaseInfo() {
requestSubscribeMessage() {
var this_ = this
var tmplIds = 'LQ4X2dgvpxC6iuZhbxv8qtqVWT9_DFEBPxu-PmggjfY'
uni.getSetting({
withSubscriptions: true,
success(res) {
// 调起授权界面弹窗
if (res.subscriptionsSetting.mainSwitch) { // 用户打开了订阅消息总开关
if (res.subscriptionsSetting.itemSettings !=
null) { // 用户同意总是保持是否推送消息的选择, 这里表示以后不会再拉起推送消息的授权
let moIdState = res.subscriptionsSetting.itemSettings[tmplIds]; // 用户同意的消息模板id
if (moIdState === 'accept') {
uni.requestSubscribeMessage({ // 调起消息订阅界面
tmplIds: [tmplIds],
success(res) {
if (res[tmplIds] == 'accept') {
this_.overlayshowclick(1)
} else if (res[tmplIds] == 'reject') {
this_.overlayshowclick(0)
} else if (res[tmplIds] == 'ban') {
this_.overlayshowclick(0)
} else if (res[tmplIds] == 'accept') {
this_.overlayshowclick(0)
} else {
this_.overlayshowclick(0)
}
},
fail(er) {
this_.overlayshowclick(0)
console.log(er);
}
})
} else if (moIdState === 'reject') {
console.log("拒绝消息推送");
this_.overlayshowclick(0)
} else if (moIdState === 'ban') {
console.log("已被后台封禁");
this_.overlayshowclick(0)
}
} else {
// 当用户没有点击 ’总是保持以上选择,不再询问‘ 按钮。那每次执到这都会拉起授权弹窗
uni.showModal({
title: '提示',
content: '请授权开通服务通知',
showCancel: true,
success: function(ress) {
if (ress.confirm) {
// console.log('用户点击确定')
uni.requestSubscribeMessage({ // 调起消息订阅界面
tmplIds: [tmplIds],
success(res) {
if (res[tmplIds] == 'accept') {
this_.overlayshowclick(1)
} else if (res[tmplIds] == 'reject') {
this_.overlayshowclick(0)
} else if (res[tmplIds] == 'ban') {
this_.overlayshowclick(0)
} else if (res[tmplIds] == 'accept') {
this_.overlayshowclick(0)
} else {
this_.overlayshowclick(0)
}
},
fail(er) {
this_.overlayshowclick(0)
console.log(er);
}
})
} else if (ress.cancel) {
this_.overlayshowclick(0)
}
}
})
}
} else {
this_.overlayshowclick(0)
}
}
})
},
async overlayshowclick(e) {
try {
if (e == 1) {
await this.api.userminidymessage({
open_id: this.form.open_id,
})
}
} catch (e) {
//TODO handle the exception
}
if (this.form.user_name == null || this.form.user_name == '') {
uni.showToast({
title: '请输入名称',

View File

@@ -33,9 +33,18 @@
<text class="classvie_itemtow">{{ datalsit.ktime }}</text>
</view>
</view>
<view style="margin-top:80rpx;text-align: center;color:#3088fd ;" v-if="datalsit.status != 2" @click="makePhoneCall(datalsit)">
联系商家
</view>
<!-- #ifdef MP-WEIXIN -->
<!-- <view style="margin-top:80rpx;text-align: center;color:#3088fd ;" v-if="datalsit.status != 2"
@click="makePhoneCall(datalsit)">
联系客服
</view> -->
<!-- #endif -->
<button open-type="contact" class="contactbutton">联系客服</button>
<!-- <view style="margin-top:80rpx;text-align: center;color:#3088fd ;" v-if="datalsit.status != 2"
@click="makePhoneCall(datalsit)">
联系客服
</view> -->
<!-- <button open-type='contact'>联系客服</button> -->
</view>
</template>
@@ -86,9 +95,15 @@
}
},
makePhoneCall(e) {
uni.makePhoneCall({
phoneNumber: e.store_mobile //仅为示例
});
// uni.navigateTo({
// url: '/pages/webview/index'
// })
uni.openCustomerServiceChat({
corpId: 'wwc76ab19fa6df267f',
success(res) {
console.log('成功了', res)
}
})
},
savealbum(e) {
uni.pro.navigateBack();
@@ -151,6 +166,20 @@
.content {
padding: 32rpx 28rpx;
.contactbutton {
margin: 40rpx 0;
padding: 0;
outline: none;
border-radius: 0;
background-color: transparent;
line-height: inherit;
color: #3088fd;
&::after {
border: none;
}
}
.content_boxtop {
padding: 22rpx 16rpx;
background: #ffffff;