|
|
|
@ -13,9 +13,7 @@ |
|
|
|
|
</div> |
|
|
|
|
</a-form-item> |
|
|
|
|
<a-form-item class="mt-30" label="小程序 AppID" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-input |
|
|
|
|
v-decorator="['app_id', { rules: [{ required: true, message: '请输入小程序AppID' }] }]" |
|
|
|
|
/> |
|
|
|
|
<a-input v-decorator="['app_id', { rules: [{ required: true, message: '请输入小程序AppID' }] }]" /> |
|
|
|
|
<p class="form-item-help"> |
|
|
|
|
<small>登录微信小程序平台,开发 - 开发管理 - 开发设置,记录AppID (小程序ID)</small> |
|
|
|
|
</p> |
|
|
|
@ -29,7 +27,62 @@ |
|
|
|
|
<small>登录微信小程序平台,开发 - 开发管理 - 开发设置,记录AppSecret (小程序密钥)</small> |
|
|
|
|
</p> |
|
|
|
|
</a-form-item> |
|
|
|
|
<a-form-item class="mt-30" label="同城送" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-radio-group v-decorator="['same_city', { rules: [{ required: true }] }]"> |
|
|
|
|
<a-radio :value="true">开启</a-radio> |
|
|
|
|
<a-radio :value="false">关闭</a-radio> |
|
|
|
|
</a-radio-group> |
|
|
|
|
<div class="form-item-help"> |
|
|
|
|
<small>注:如关闭,用户则无法通过微信小程序端访问同城送</small> |
|
|
|
|
</div> |
|
|
|
|
</a-form-item> |
|
|
|
|
<a-form-item class="mt-30" label="新人首礼" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-radio-group v-decorator="['new_first_gift', { rules: [{ required: true }] }]"> |
|
|
|
|
<a-radio :value="true">开启</a-radio> |
|
|
|
|
<a-radio :value="false">关闭</a-radio> |
|
|
|
|
</a-radio-group> |
|
|
|
|
<div class="form-item-help"> |
|
|
|
|
<small>注:如关闭,用户则无法通过微信小程序端访问新人首礼</small> |
|
|
|
|
</div> |
|
|
|
|
</a-form-item> |
|
|
|
|
<a-form-item class="mt-30" label="大牌正品" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-radio-group v-decorator="['big_brand', { rules: [{ required: true }] }]"> |
|
|
|
|
<a-radio :value="true">开启</a-radio> |
|
|
|
|
<a-radio :value="false">关闭</a-radio> |
|
|
|
|
</a-radio-group> |
|
|
|
|
<div class="form-item-help"> |
|
|
|
|
<small>注:如关闭,用户则无法通过微信小程序端访问大牌正品</small> |
|
|
|
|
</div> |
|
|
|
|
</a-form-item> |
|
|
|
|
<a-form-item class="mt-30" label="新品首发" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-radio-group v-decorator="['new_product', { rules: [{ required: true }] }]"> |
|
|
|
|
<a-radio :value="true">开启</a-radio> |
|
|
|
|
<a-radio :value="false">关闭</a-radio> |
|
|
|
|
</a-radio-group> |
|
|
|
|
<div class="form-item-help"> |
|
|
|
|
<small>注:如关闭,用户则无法通过微信小程序端访问新品首发</small> |
|
|
|
|
</div> |
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
|
|
<a-form-item class="mt-30" label="排行榜" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-radio-group v-decorator="['ranking_list', { rules: [{ required: true }] }]"> |
|
|
|
|
<a-radio :value="true">开启</a-radio> |
|
|
|
|
<a-radio :value="false">关闭</a-radio> |
|
|
|
|
</a-radio-group> |
|
|
|
|
<div class="form-item-help"> |
|
|
|
|
<small>注:如关闭,用户则无法通过微信小程序端访问排行榜</small> |
|
|
|
|
</div> |
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
|
|
<a-form-item class="mt-30" label="服务" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-radio-group v-decorator="['service', { rules: [{ required: true }] }]"> |
|
|
|
|
<a-radio :value="true">开启</a-radio> |
|
|
|
|
<a-radio :value="false">关闭</a-radio> |
|
|
|
|
</a-radio-group> |
|
|
|
|
<div class="form-item-help"> |
|
|
|
|
<small>注:如关闭,用户则无法通过微信小程序端访问服务</small> |
|
|
|
|
</div> |
|
|
|
|
</a-form-item> |
|
|
|
|
<a-divider orientation="left">授权域名设置</a-divider> |
|
|
|
|
<a-form-item |
|
|
|
|
v-for="(item, index) in domainList" |
|
|
|
@ -41,11 +94,9 @@ |
|
|
|
|
required |
|
|
|
|
> |
|
|
|
|
<span class="f-14">{{ `${item.protocol}://${domain}` }}</span> |
|
|
|
|
<a |
|
|
|
|
class="ml-15 f-12" |
|
|
|
|
href="javascript:void(0);" |
|
|
|
|
@click="handleCopyLink(`${item.protocol}://${domain}`)" |
|
|
|
|
>点击复制</a> |
|
|
|
|
<a class="ml-15 f-12" href="javascript:void(0);" @click="handleCopyLink(`${item.protocol}://${domain}`)" |
|
|
|
|
>点击复制</a |
|
|
|
|
> |
|
|
|
|
<p class="form-item-help"> |
|
|
|
|
<small>登录小程序平台,开发 - 开发管理 - 开发设置 - 服务器域名,修改{{ item.protocol }}协议业务域名</small> |
|
|
|
|
</p> |
|
|
|
@ -68,19 +119,19 @@ import * as Api from '@/api/client/wxapp/setting' |
|
|
|
|
const domainList = [ |
|
|
|
|
{ |
|
|
|
|
name: 'request', |
|
|
|
|
protocol: 'https' |
|
|
|
|
protocol: 'https', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'socket', |
|
|
|
|
protocol: 'wss' |
|
|
|
|
protocol: 'wss', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'uploadFile', |
|
|
|
|
protocol: 'https' |
|
|
|
|
protocol: 'https', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'downloadFile', |
|
|
|
|
protocol: 'https' |
|
|
|
|
protocol: 'https', |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
|
|
|
|
@ -111,32 +162,44 @@ export default { |
|
|
|
|
this.getDetail() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
|
|
|
|
|
// 获取当前详情记录 |
|
|
|
|
getDetail() { |
|
|
|
|
this.isLoading = true |
|
|
|
|
Api.detail(this.key) |
|
|
|
|
.then(result => { |
|
|
|
|
.then((result) => { |
|
|
|
|
// 当前记录 |
|
|
|
|
this.record = result.data.detail |
|
|
|
|
this.domain = result.data.domain |
|
|
|
|
// 设置默认值 |
|
|
|
|
this.setFieldsValue() |
|
|
|
|
}) |
|
|
|
|
.finally(() => this.isLoading = false) |
|
|
|
|
.finally(() => (this.isLoading = false)) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 设置默认值 |
|
|
|
|
setFieldsValue() { |
|
|
|
|
const { record, $nextTick, form } = this |
|
|
|
|
!isEmpty(form.getFieldsValue()) && $nextTick(() => { |
|
|
|
|
form.setFieldsValue(pick(record, ['enabled', 'app_id', 'app_secret'])) |
|
|
|
|
!isEmpty(form.getFieldsValue()) && |
|
|
|
|
$nextTick(() => { |
|
|
|
|
form.setFieldsValue( |
|
|
|
|
pick(record, [ |
|
|
|
|
'enabled', |
|
|
|
|
'app_id', |
|
|
|
|
'app_secret', |
|
|
|
|
'same_city', |
|
|
|
|
'new_first_gift', |
|
|
|
|
'big_brand', |
|
|
|
|
'new_product', |
|
|
|
|
'ranking_list', |
|
|
|
|
'service', |
|
|
|
|
]) |
|
|
|
|
) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 复制链接地址 |
|
|
|
|
handleCopyLink(url) { |
|
|
|
|
this.$copyText(url).then(res => { |
|
|
|
|
this.$copyText(url).then((res) => { |
|
|
|
|
this.$message.success('复制成功', 0.8) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
@ -145,7 +208,9 @@ export default { |
|
|
|
|
handleSubmit(e) { |
|
|
|
|
e.preventDefault() |
|
|
|
|
// 表单验证 |
|
|
|
|
const { form: { validateFields } } = this |
|
|
|
|
const { |
|
|
|
|
form: { validateFields }, |
|
|
|
|
} = this |
|
|
|
|
validateFields((errors, values) => { |
|
|
|
|
// 提交到后端api |
|
|
|
|
!errors && this.onFormSubmit(values) |
|
|
|
@ -156,11 +221,10 @@ export default { |
|
|
|
|
onFormSubmit(values) { |
|
|
|
|
this.isLoading = true |
|
|
|
|
Api.update(this.key, { form: values }) |
|
|
|
|
.then(result => this.$message.success(result.message, 1.5)) |
|
|
|
|
.finally(() => this.isLoading = false) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
.then((result) => this.$message.success(result.message, 1.5)) |
|
|
|
|
.finally(() => (this.isLoading = false)) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
<style lang="less" scoped> |
|
|
|
|