| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866 |
- <template>
- <div class="edit-equity-product">
- <el-card>
- <div slot="header" class="header-title">
- <span>编辑权益</span>
- </div>
- <!-- 步骤条 -->
- <el-steps :active="activeStep" simple style="margin-bottom: 20px;">
- <el-step title="填写权益信息" icon="el-icon-info"></el-step>
- <el-step title="设置规则" icon="el-icon-setting"></el-step>
- <el-step title="更多设置" icon="el-icon-monitor"></el-step>
- </el-steps>
- <!-- 步骤内容 -->
- <div v-show="activeStep === 0">
- <!-- 基本信息 -->
- <el-card shadow="never" class="section-card">
- <div slot="header" class="section-title">基本信息</div>
- <el-form :model="form" label-width="120px" label-position="left">
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="权益来源" required>
- <!-- 编辑时不允许修改权益来源 -->
- <el-radio-group v-model="form.source" disabled>
- <el-radio-button label="银行自有"></el-radio-button>
- <el-radio-button label="荣数商品"></el-radio-button>
- <el-radio-button label="第三方"></el-radio-button>
- </el-radio-group>
- </el-form-item>
- </el-col>
- <el-col :span="8" v-if="form.source === '荣数商品'">
- <el-form-item label="选择权益" required>
- <el-input
- v-model="form.rongshuProduct"
- placeholder="请选择权益"
- readonly
- >
- <el-button slot="append" @click="rongshuDialogVisible = true">选择</el-button>
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8" v-if="form.source === '银行自有'">
- <el-form-item label="权益类型" required>
- <el-radio-group v-model="form.productType">
- <el-radio-button label="券码"></el-radio-button>
- </el-radio-group>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="8" v-if="form.source === '第三方'">
- <el-form-item label="外部权益链接" required>
- <el-select v-model="form.externalLink" placeholder="请选择外部权益链接">
- <el-option label="太古地产" value="太古地产"></el-option>
- <el-option label="龙腾" value="龙腾"></el-option>
- <el-option label="h5链接" value="h5链接"></el-option>
- <el-option label="小程序链接" value="小程序链接"></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8" v-if="form.source === '第三方' && form.externalLink === 'h5链接'">
- <el-form-item label="h5链接" required>
- <el-input v-model="form.customLink" placeholder="请输入h5链接"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8" v-if="form.source === '第三方'">
- <el-form-item required label-width="140px">
- <span slot="label" style="white-space: nowrap;">是否有详情页<el-tooltip content="没有详情页时直接从首页/列表页跳转" placement="top"><i class="el-icon-question tip-icon"></i></el-tooltip></span>
- <el-radio-group v-model="form.externalJumpMethod">
- <el-radio-button label="没有"></el-radio-button>
- <el-radio-button label="有"></el-radio-button>
- </el-radio-group>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20" v-if="form.source === '第三方' && form.externalLink === '小程序链接'">
- <el-col :span="8">
- <el-form-item label="小程序appid" required>
- <el-input v-model="form.miniAppId" placeholder="请输入小程序appid"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="小程序页面地址" required label-width="140px">
- <el-input v-model="form.miniAppPath" placeholder="请输入小程序页面地址"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <template v-if="form.source === '银行自有' || form.source === '荣数商品'">
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="权益名称" required>
- <el-input v-model="form.equityName" maxlength="40" placeholder="请输入权益名称"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="权益副标题">
- <el-input v-model="form.subTitle" maxlength="40" placeholder="请输入权益副标题"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20" v-if="form.source === '荣数商品'">
- <el-col :span="8">
- <el-form-item label="库存数" required>
- <el-input-number
- v-model="form.stockCount"
- :min="0"
- :max="100000"
- style="width: 100%"
- ></el-input-number>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item required>
- <span slot="label">权益图标
- <el-tooltip content="展示在权益首页和权益列表页" placement="top">
- <i class="el-icon-question tip-icon"></i>
- </el-tooltip>
- </span>
- <el-upload
- action=""
- :auto-upload="false"
- :file-list="form.listIcon"
- :on-change="file => handleUpload(file, 'listIcon')"
- :on-preview="handlePreviewImage"
- :on-remove="() => form.listIcon = []"
- :class="{ 'upload-hide-trigger': form.listIcon.length >= 1 }"
- :limit="1"
- list-type="picture-card"
- >
- <i class="el-icon-plus"></i>
- </el-upload>
- <div class="upload-size-tip">建议尺寸:80x80px</div>
- </el-form-item>
- </el-col>
- </el-row>
- </template>
- <template v-else-if="form.source === '第三方'">
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="权益名称" required>
- <el-input v-model="form.equityName" maxlength="40" placeholder="请输入权益名称"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="权益副标题">
- <el-input v-model="form.subTitle" maxlength="40" placeholder="请输入权益副标题"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20" v-if="form.externalJumpMethod === '没有'">
- <el-col :span="8">
- <el-form-item required>
- <span slot="label">权益图标
- <el-tooltip content="展示在权益首页和权益列表页" placement="top">
- <i class="el-icon-question tip-icon"></i>
- </el-tooltip>
- </span>
- <el-upload
- action=""
- :auto-upload="false"
- :file-list="form.listIcon"
- :on-change="file => handleUpload(file, 'listIcon')"
- :on-preview="handlePreviewImage"
- :on-remove="() => form.listIcon = []"
- :class="{ 'upload-hide-trigger': form.listIcon.length >= 1 }"
- :limit="1"
- list-type="picture-card"
- >
- <i class="el-icon-plus"></i>
- </el-upload>
- <div class="upload-size-tip">建议尺寸:80x80px</div>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="form.externalJumpMethod === '有'" :gutter="20">
- <el-col :span="8">
- <el-form-item required>
- <span slot="label">权益图标
- <el-tooltip content="展示在权益首页和权益列表页" placement="top">
- <i class="el-icon-question tip-icon"></i>
- </el-tooltip>
- </span>
- <el-upload
- action=""
- :auto-upload="false"
- :file-list="form.listIcon"
- :on-change="file => handleUpload(file, 'listIcon')"
- :on-preview="handlePreviewImage"
- :on-remove="() => form.listIcon = []"
- :class="{ 'upload-hide-trigger': form.listIcon.length >= 1 }"
- :limit="1"
- list-type="picture-card"
- >
- <i class="el-icon-plus"></i>
- </el-upload>
- <div class="upload-size-tip">建议尺寸:80x80px</div>
- </el-form-item>
- </el-col>
- </el-row>
- </template>
- </el-form>
- </el-card>
- <!-- 详情信息 -->
- <el-card v-if="shouldShowDetailCard" shadow="never" class="section-card">
- <div slot="header" class="section-title">详情信息</div>
- <el-form :model="form" label-width="120px" label-position="left">
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="权益主图" required>
- <el-upload
- action=""
- :auto-upload="false"
- :file-list="form.mainImage"
- :on-change="file => handleUpload(file, 'mainImage')"
- :on-preview="handlePreviewImage"
- :on-remove="() => form.mainImage = []"
- :class="{ 'upload-hide-trigger': form.mainImage.length >= 1 }"
- :limit="1"
- list-type="picture-card"
- >
- <i class="el-icon-plus"></i>
- </el-upload>
- <div class="upload-size-tip">建议尺寸:716x400px</div>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="权益介绍" required>
- <el-input
- v-model="form.introduction"
- type="textarea"
- :rows="4"
- maxlength="500"
- show-word-limit
- placeholder="请输入权益介绍"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="权益内容" required>
- <quill-editor v-model="form.overview" :options="quillOptions"></quill-editor>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="权益说明" required>
- <quill-editor v-model="form.details" :options="quillOptions"></quill-editor>
- </el-form-item>
- </el-col>
- </el-row>
- <template v-if="form.source === '银行自有' || form.source === '荣数商品'">
- <el-row :gutter="20">
- <el-col :span="24">
- <el-form-item>
- <span slot="label">下单成功短信
- <el-tooltip placement="top">
- <div slot="content">
- 此模板为权益支付成功,发送给持卡人的短信模板;<br/>
- 开启后需选择短信模板,关闭则不发送短信。<br/>
- 占位符如下:<br/>
- 权益名称:${productName}<br/>
- 结束日期:${expireDate}<br/>
- 卡号:${exchangeNum}<br/>
- 卡密:${exchangePwd}<br/>
- 券码路径:${qrCodeDownPaths}
- </div>
- <i class="el-icon-question tip-icon"></i>
- </el-tooltip>
- </span>
- <el-switch v-model="form.smsEnabled" @change="handleSmsEnabledChange"></el-switch>
- <template v-if="form.smsEnabled">
- <div style="width: 600px;background: #f1f2f5;padding: 20px;margin-top: 10px;">
- <el-select
- v-model="form.smsTemplateId"
- placeholder="请选择短信模板"
- style="width: 100%"
- @change="handleSmsTemplateChange"
- >
- <el-option
- v-for="item in smsTemplateOptions"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- <div v-if="form.smsTemplate" class="sms-template-preview">{{ form.smsTemplate }}</div>
- </div>
- </template>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="领取成功按钮" required>
- <el-input v-model="form.successButtonText" placeholder="请输入按钮文案"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </template>
- </el-form>
- </el-card>
- </div>
- <div v-show="activeStep === 1">
- <!-- 设置规则 -->
- <el-card shadow="never" class="section-card">
- <div slot="header" class="section-title">设置规则</div>
- <div slot="header" class="section-title">展示规则</div>
- <el-form :model="form" label-width="120px" label-position="left">
- <el-form-item label="展示时间限制">
- <el-switch v-model="form.showTimeEnabled"></el-switch>
- <template v-if="form.showTimeEnabled">
- <div style="display: flex;width: 600px;background: #f1f2f5;padding: 20px;margin-top: 10px;">
- <el-date-picker
- v-model="form.showStartTime"
- type="datetime"
- placeholder="请选择开始时间"
- format="yyyy-MM-dd HH:mm:ss"
- value-format="yyyy-MM-dd HH:mm:ss"
- style="width: 100%"
- ></el-date-picker>
- <div style="width: 50px;text-align: center;">-</div>
- <el-date-picker
- v-model="form.showEndTime"
- type="datetime"
- placeholder="请选择结束时间"
- format="yyyy-MM-dd HH:mm:ss"
- value-format="yyyy-MM-dd HH:mm:ss"
- style="width: 100%"
- ></el-date-picker>
- </div>
- </template>
- </el-form-item>
- <el-form-item label="展示客群限制">
- <el-switch v-model="form.showGroupEnabled"></el-switch>
- <template v-if="form.showGroupEnabled">
- <div style="display: flex;width: 600px;background: #f1f2f5;padding: 20px;margin-top: 10px;">
- <el-select v-model="form.showGroupTagIds" multiple filterable placeholder="请选择客群" style="width: 100%">
- <el-option label="客群A" value="客群A"></el-option>
- <el-option label="客群B" value="客群B"></el-option>
- <el-option label="客群C" value="客群C"></el-option>
- </el-select>
- </div>
- </template>
- </el-form-item>
- </el-form>
- </el-card>
- <!-- 领取规则 -->
- <el-card shadow="never" class="section-card">
- <div slot="header" class="section-title">领取规则</div>
- <el-form :model="form" label-width="120px" label-position="left">
- <el-form-item label="领取时间限制">
- <el-switch v-model="form.claimTimeEnabled"></el-switch>
- <template v-if="form.claimTimeEnabled">
- <div style="display: flex;width: 600px;background: #f1f2f5;padding: 20px;margin-top: 10px;">
- <el-date-picker
- v-model="form.claimStartTime"
- type="datetime"
- placeholder="请选择开始时间"
- format="yyyy-MM-dd HH:mm:ss"
- value-format="yyyy-MM-dd HH:mm:ss"
- style="width: 100%"
- ></el-date-picker>
- <div style="width: 50px;text-align: center;">-</div>
- <el-date-picker
- v-model="form.claimEndTime"
- type="datetime"
- placeholder="请选择结束时间"
- format="yyyy-MM-dd HH:mm:ss"
- value-format="yyyy-MM-dd HH:mm:ss"
- style="width: 100%"
- ></el-date-picker>
- </div>
- </template>
- </el-form-item>
- <el-form-item label="领取客群限制">
- <el-switch v-model="form.claimGroupEnabled"></el-switch>
- <template v-if="form.claimGroupEnabled">
- <div style="width: 600px;background: #f1f2f5;padding: 20px;margin-top: 10px;">
- <el-alert
- title="需在【权益管理-权益发放】中选择权益发放,未发放的权益移动端不展示"
- type="info"
- :closable="false"
- show-icon
- style="margin-bottom: 12px;"
- ></el-alert>
- <div style="font-size: 14px;color: #606266;margin-bottom: 8px;font-weight: 500;">不满足提示</div>
- <el-form-item label="提示内容" label-width="80px" style="margin-bottom: 12px;">
- <el-input v-model="form.claimDenyMessage" maxlength="200" placeholder="请输入提示内容"></el-input>
- </el-form-item>
- <el-form-item label="跳转按钮文案" label-width="100px" style="margin-bottom: 12px;">
- <el-input v-model="form.claimDenyButtonText" maxlength="10" placeholder="请输入按钮文案"></el-input>
- </el-form-item>
- <el-form-item label="跳转按钮链接" label-width="100px" style="margin-bottom: 0;">
- <el-input v-model="form.claimDenyButtonLink" maxlength="200" placeholder="请输入按钮链接"></el-input>
- </el-form-item>
- </div>
- </template>
- </el-form-item>
- </el-form>
- </el-card>
- </div>
- <div v-show="activeStep === 2">
- <!-- 显示页面 -->
- <el-card shadow="never" class="section-card">
- <div slot="header" class="section-title">显示页面</div>
- <el-form :model="form" label-width="120px" label-position="left">
- <el-form-item label="权益首页/列表页">
- <el-radio-group v-model="form.showOnHome">
- <el-radio label="显示">显示</el-radio>
- <el-radio label="不显示">不显示</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="组装页">
- <el-radio-group v-model="form.showOnAssembly">
- <el-radio label="显示">显示</el-radio>
- <el-radio label="不显示">不显示</el-radio>
- </el-radio-group>
- <div
- v-if="form.showOnAssembly === '显示'"
- style="width: 600px;background: #f1f2f5;padding: 20px;margin-top: 10px;"
- >
- <el-select
- v-model="form.assemblyPages"
- multiple
- filterable
- placeholder="请选择组装页"
- style="width: 100%"
- >
- <el-option label="组装页A" value="组装页A"></el-option>
- <el-option label="组装页B" value="组装页B"></el-option>
- <el-option label="组装页C" value="组装页C"></el-option>
- <el-option label="组装页D" value="组装页D"></el-option>
- </el-select>
- </div>
- </el-form-item>
- </el-form>
- </el-card>
- <!-- 分享设置 -->
- <el-card shadow="never" class="section-card">
- <div slot="header" class="section-title">分享设置</div>
- <el-form :model="form" label-width="120px" label-position="left">
- <el-form-item label="是否支持分享">
- <el-switch v-model="form.shareEnabled" @change="handleShareEnabledChange"></el-switch>
- <template v-if="form.shareEnabled">
- <div style="width: 600px;background: #f1f2f5;padding: 20px;margin-top: 10px;">
- <el-form-item label="分享名称" label-width="100px" required style="margin-bottom: 16px;">
- <el-input
- v-model="form.shareName"
- maxlength="40"
- placeholder="请输入分享名称"
- ></el-input>
- </el-form-item>
- <el-form-item label="分享图片" label-width="100px" required style="margin-bottom: 0;">
- <el-upload
- action=""
- :auto-upload="false"
- :file-list="form.shareImage"
- :on-change="file => handleUpload(file, 'shareImage')"
- :limit="1"
- list-type="picture-card"
- >
- <i class="el-icon-plus"></i>
- </el-upload>
- </el-form-item>
- </div>
- </template>
- </el-form-item>
- </el-form>
- </el-card>
- </div>
- <!-- 操作栏 -->
- <div class="action-bar">
- <div class="action-left">
- <el-button
- v-if="activeStep > 0"
- @click="prevStep"
- icon="el-icon-arrow-left"
- >上一步</el-button>
- </div>
- <div class="action-center">
- <template v-if="activeStep === 2">
- <el-button type="primary" @click="handleSubmit">保存</el-button>
- <el-button @click="goBack">取消</el-button>
- </template>
- </div>
- <div class="action-right">
- <el-button
- v-if="activeStep < 2"
- type="primary"
- @click="nextStep"
- >下一步<i class="el-icon-arrow-right el-icon--right"></i></el-button>
- </div>
- </div>
- </el-card>
- <rongshu-product-dialog
- :visible.sync="rongshuDialogVisible"
- @select="onRongshuSelect"
- />
- <el-dialog :visible.sync="previewVisible" title="图片预览" width="640px" append-to-body>
- <img v-if="previewImageUrl" :src="previewImageUrl" style="display:block; max-width:100%; margin:0 auto;" />
- </el-dialog>
- </div>
- </template>
- <script>
- import RongshuProductDialog from '@/components/RongshuProductDialog.vue'
- export default {
- name: 'EditEquityProduct',
- components: { RongshuProductDialog },
- data() {
- return {
- activeStep: 0,
- rongshuDialogVisible: false,
- previewVisible: false,
- previewImageUrl: '',
- quillOptions: {
- placeholder: '请输入内容...',
- modules: {
- toolbar: [
- ['bold', 'italic', 'underline'],
- [{ list: 'ordered' }, { list: 'bullet' }],
- [{ header: [1, 2, 3, false] }],
- ['link', 'image'],
- ['clean']
- ]
- }
- },
- smsTemplateOptions: [
- { id: 'SMS_TPL_001', name: '通用权益支付成功模板', content: '【银行】您购买的${productName}已支付成功,卡号:${exchangeNum},卡密:${exchangePwd},有效期至${expireDate},详情:${qrCodeDownPaths}' },
- { id: 'SMS_TPL_002', name: '券码类短信模板', content: '【银行】尊敬的客户,您的${productName}购买成功,券码为${exchangeNum},请于${expireDate}前使用。' },
- { id: 'SMS_TPL_003', name: '实物类短信模板', content: '【银行】您购买的${productName}已受理,我们将尽快安排发货,感谢您的支持。' }
- ],
- form: {
- source: '银行自有',
- rongshuProduct: '',
- productType: '券码',
- faceValueThreshold: '',
- faceValueDiscount: '',
- stockCount: null,
- shareEnabled: false,
- shareImage: [],
- shareName: '',
- externalJumpMethod: '没有',
- externalLink: '太古地产',
- customLink: '',
- miniAppId: '',
- miniAppPath: '',
- skuNo: '',
- equityName: '',
- productId: '',
- merchantName: '',
- subTitle: '',
- listIcon: [],
- mainImage: [],
- introduction: '',
- overview: '',
- details: '',
- smsEnabled: false,
- smsTemplateId: '',
- smsTemplate: '',
- successButtonText: '',
- showTimeEnabled: false,
- showStartTime: '',
- showEndTime: '',
- showGroupEnabled: false,
- showGroupTagIds: [],
- claimTimeEnabled: false,
- claimStartTime: '',
- claimEndTime: '',
- claimGroupEnabled: false,
- claimGroupIsPotential: false,
- claimGroupTagId: '',
- claimDenyMessage: '',
- claimDenyButtonText: '',
- claimDenyButtonLink: '',
- showOnHome: '显示',
- showOnAssembly: '不显示',
- assemblyPages: []
- }
- }
- },
- computed: {
- shouldShowDetailCard() {
- const s = this.form.source
- if (s === '银行自有' || s === '荣数商品') return true
- if (s === '第三方' && this.form.externalJumpMethod === '有') return true
- return false
- }
- },
- created() {
- this.loadData()
- },
- methods: {
- loadData() {
- const id = this.$route.params.id
- const mockMap = {
- 100001: {
- source: '银行自有',
- externalJumpMethod: '',
- externalLink: '',
- customLink: '',
- miniAppId: '',
- miniAppPath: '',
- skuNo: 'SKU001',
- equityName: '权益A',
- subTitle: '副标题示例',
- listIcon: [],
- mainImage: [],
- overview: '<p>权益内容内容</p>',
- details: '<p>权益说明内容</p>',
- smsEnabled: true,
- smsTemplateId: 'SMS_TPL_001',
- smsTemplate: '【银行】您购买的${productName}已支付成功,卡号:${exchangeNum},卡密:${exchangePwd},有效期至${expireDate},详情:${qrCodeDownPaths}',
- successButtonText: '马上去使用',
- showTimeEnabled: true,
- showStartTime: '2026-01-01 00:00:00',
- showEndTime: '2026-12-31 23:59:59',
- showGroupEnabled: false,
- showGroupTagIds: [],
- claimTimeEnabled: true,
- claimStartTime: '2026-01-01 00:00:00',
- claimEndTime: '2026-12-31 23:59:59',
- claimGroupEnabled: false,
- claimGroupTagId: '',
- claimDenyMessage: '',
- claimDenyButtonText: '',
- claimDenyButtonLink: ''
- },
- 100002: {
- source: '第三方',
- externalJumpMethod: '没有',
- externalLink: '太古地产',
- customLink: '',
- miniAppId: '',
- miniAppPath: '',
- skuNo: 'SKU002',
- equityName: '权益B',
- subTitle: '外部列表页副标题',
- listIcon: [],
- mainImage: [],
- overview: '',
- details: '',
- smsEnabled: false,
- smsTemplateId: '',
- smsTemplate: '',
- successButtonText: '',
- showTimeEnabled: false,
- showStartTime: '',
- showEndTime: '',
- showGroupEnabled: true,
- showGroupTagIds: ['客群A'],
- claimTimeEnabled: true,
- claimStartTime: '2026-02-01 00:00:00',
- claimEndTime: '2026-11-30 23:59:59',
- claimGroupEnabled: true,
- claimGroupIsPotential: false,
- claimGroupTagId: '客群奖励活动A',
- claimDenyMessage: '您暂不满足领取条件',
- claimDenyButtonText: '去升级',
- claimDenyButtonLink: 'https://example.com/upgrade'
- },
- 100003: {
- source: '第三方',
- externalJumpMethod: '有',
- externalLink: '龙腾',
- customLink: '',
- miniAppId: '',
- miniAppPath: '',
- skuNo: 'SKU003',
- equityName: '权益C',
- subTitle: '外部详情页副标题',
- listIcon: [],
- mainImage: [],
- overview: '<p>外部详情页权益内容</p>',
- details: '<p>外部详情页权益说明</p>',
- smsEnabled: false,
- smsTemplateId: '',
- smsTemplate: '',
- successButtonText: '',
- showTimeEnabled: false,
- showStartTime: '',
- showEndTime: '',
- showGroupEnabled: false,
- showGroupTagIds: [],
- claimTimeEnabled: false,
- claimStartTime: '',
- claimEndTime: '',
- claimGroupEnabled: false,
- claimGroupTagId: '',
- claimDenyMessage: '',
- claimDenyButtonText: '',
- claimDenyButtonLink: ''
- },
- 100004: {
- source: '第三方',
- externalJumpMethod: '有',
- externalLink: 'h5链接',
- customLink: 'https://example.com/custom',
- skuNo: 'SKU004',
- equityName: '权益D',
- subTitle: '外部自定义链接副标题',
- listIcon: [],
- mainImage: [],
- overview: '<p>自定义链接权益内容</p>',
- details: '<p>自定义链接权益说明</p>',
- smsEnabled: false,
- smsTemplateId: '',
- smsTemplate: '',
- successButtonText: '',
- showTimeEnabled: false,
- showStartTime: '',
- showEndTime: '',
- showGroupEnabled: false,
- showGroupTagIds: [],
- claimTimeEnabled: false,
- claimStartTime: '',
- claimEndTime: '',
- claimGroupEnabled: false,
- claimGroupTagId: '',
- claimDenyMessage: '',
- claimDenyButtonText: '',
- claimDenyButtonLink: ''
- }
- }
- if (id && mockMap[id]) {
- Object.assign(this.form, mockMap[id])
- }
- },
- nextStep() {
- if (this.activeStep < 2) {
- this.activeStep++
- }
- },
- prevStep() {
- if (this.activeStep > 0) {
- this.activeStep--
- }
- },
- handleSubmit() {
- this.$message.success('保存成功')
- this.$router.push('/customization/hsbc/equity-products')
- },
- goBack() {
- this.$router.push('/customization/hsbc/equity-products')
- },
- handleSmsEnabledChange(val) {
- if (!val) {
- this.form.smsTemplateId = ''
- this.form.smsTemplate = ''
- }
- },
- handleShareEnabledChange(val) {
- if (val) {
- if (!this.form.shareName) {
- this.form.shareName = this.form.equityName || ''
- }
- }
- },
- handleSmsTemplateChange(id) {
- const tpl = this.smsTemplateOptions.find(i => i.id === id)
- this.form.smsTemplate = tpl ? tpl.content : ''
- },
- handleUpload(file, field) {
- if (!file || !file.raw) return
- const reader = new FileReader()
- reader.onload = (e) => {
- this.form[field] = [{ name: file.name, url: e.target.result, uid: file.uid }]
- }
- reader.readAsDataURL(file.raw)
- },
- handlePreviewImage(file) {
- this.previewImageUrl = file.url || ''
- this.previewVisible = !!this.previewImageUrl
- },
- onRongshuSelect(product) {
- this.form.rongshuProduct = product.name
- this.form.equityName = product.name
- this.form.merchantName = product.merchant
- this.form.stockCount = product.stock
- this.form.mainImage = product.mainImage ? [...product.mainImage] : []
- }
- }
- }
- </script>
- <style scoped>
- .edit-equity-product {
- padding: 20px;
- }
- .header-title {
- font-size: 18px;
- font-weight: 500;
- }
- .section-card {
- margin-bottom: 16px;
- border: none;
- }
- .upload-hide-trigger >>> .el-upload--picture-card { display: none; }
- .section-card >>> .el-card__header {
- padding: 12px 20px;
- background: #fafafa;
- border-bottom: 1px solid #ebeef5;
- }
- .section-title {
- font-size: 16px;
- font-weight: 600;
- color: #303133;
- }
- .action-bar {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-top: 20px;
- padding-top: 20px;
- border-top: 1px solid #ebeef5;
- }
- .action-left, .action-right {
- width: 120px;
- }
- .action-center {
- display: flex;
- justify-content: center;
- gap: 12px;
- }
- .tip-icon {
- color: #909399;
- cursor: pointer;
- font-size: 14px;
- }
- .upload-size-tip {
- margin-top: 4px;
- font-size: 12px;
- color: #909399;
- line-height: 1.5;
- }
- .sms-template-preview {
- margin-top: 12px;
- padding: 12px;
- background: #fff;
- border: 1px dashed #dcdfe6;
- border-radius: 4px;
- font-size: 13px;
- color: #606266;
- line-height: 1.6;
- white-space: pre-wrap;
- word-break: break-all;
- }
- </style>
|