You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong_qianduan/common/model/mp/alipay/Setting.js

31 lines
708 B

4 months ago
import StoreModel from '@/common/model/Store'
/**
* 获取支付宝小程序设置 (全部)
*/
const data = () => {
return new Promise((resolve, reject) => {
StoreModel.data().then(data => {
resolve(data.clientData.mpAlipay.setting ? data.clientData.mpAlipay.setting : [])
})
})
}
// 获取支付宝小程序设置 (指定项)
const item = (key) => {
return new Promise((resolve, reject) => {
data().then(setting => resolve(setting[key]))
})
}
// 是否显示客服按钮 (仅在支付宝小程序中显示)
const isShowCustomerBtn = async () => {
const setting = await item('customer', true)
return setting.enabled
}
export default {
data,
item,
isShowCustomerBtn
}