EditEquityProduct.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866
  1. <template>
  2. <div class="edit-equity-product">
  3. <el-card>
  4. <div slot="header" class="header-title">
  5. <span>编辑权益</span>
  6. </div>
  7. <!-- 步骤条 -->
  8. <el-steps :active="activeStep" simple style="margin-bottom: 20px;">
  9. <el-step title="填写权益信息" icon="el-icon-info"></el-step>
  10. <el-step title="设置规则" icon="el-icon-setting"></el-step>
  11. <el-step title="更多设置" icon="el-icon-monitor"></el-step>
  12. </el-steps>
  13. <!-- 步骤内容 -->
  14. <div v-show="activeStep === 0">
  15. <!-- 基本信息 -->
  16. <el-card shadow="never" class="section-card">
  17. <div slot="header" class="section-title">基本信息</div>
  18. <el-form :model="form" label-width="120px" label-position="left">
  19. <el-row :gutter="20">
  20. <el-col :span="8">
  21. <el-form-item label="权益来源" required>
  22. <!-- 编辑时不允许修改权益来源 -->
  23. <el-radio-group v-model="form.source" disabled>
  24. <el-radio-button label="银行自有"></el-radio-button>
  25. <el-radio-button label="荣数商品"></el-radio-button>
  26. <el-radio-button label="第三方"></el-radio-button>
  27. </el-radio-group>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :span="8" v-if="form.source === '荣数商品'">
  31. <el-form-item label="选择权益" required>
  32. <el-input
  33. v-model="form.rongshuProduct"
  34. placeholder="请选择权益"
  35. readonly
  36. >
  37. <el-button slot="append" @click="rongshuDialogVisible = true">选择</el-button>
  38. </el-input>
  39. </el-form-item>
  40. </el-col>
  41. <el-col :span="8" v-if="form.source === '银行自有'">
  42. <el-form-item label="权益类型" required>
  43. <el-radio-group v-model="form.productType">
  44. <el-radio-button label="券码"></el-radio-button>
  45. </el-radio-group>
  46. </el-form-item>
  47. </el-col>
  48. </el-row>
  49. <el-row :gutter="20">
  50. <el-col :span="8" v-if="form.source === '第三方'">
  51. <el-form-item label="外部权益链接" required>
  52. <el-select v-model="form.externalLink" placeholder="请选择外部权益链接">
  53. <el-option label="太古地产" value="太古地产"></el-option>
  54. <el-option label="龙腾" value="龙腾"></el-option>
  55. <el-option label="h5链接" value="h5链接"></el-option>
  56. <el-option label="小程序链接" value="小程序链接"></el-option>
  57. </el-select>
  58. </el-form-item>
  59. </el-col>
  60. <el-col :span="8" v-if="form.source === '第三方' && form.externalLink === 'h5链接'">
  61. <el-form-item label="h5链接" required>
  62. <el-input v-model="form.customLink" placeholder="请输入h5链接"></el-input>
  63. </el-form-item>
  64. </el-col>
  65. <el-col :span="8" v-if="form.source === '第三方'">
  66. <el-form-item required label-width="140px">
  67. <span slot="label" style="white-space: nowrap;">是否有详情页<el-tooltip content="没有详情页时直接从首页/列表页跳转" placement="top"><i class="el-icon-question tip-icon"></i></el-tooltip></span>
  68. <el-radio-group v-model="form.externalJumpMethod">
  69. <el-radio-button label="没有"></el-radio-button>
  70. <el-radio-button label="有"></el-radio-button>
  71. </el-radio-group>
  72. </el-form-item>
  73. </el-col>
  74. </el-row>
  75. <el-row :gutter="20" v-if="form.source === '第三方' && form.externalLink === '小程序链接'">
  76. <el-col :span="8">
  77. <el-form-item label="小程序appid" required>
  78. <el-input v-model="form.miniAppId" placeholder="请输入小程序appid"></el-input>
  79. </el-form-item>
  80. </el-col>
  81. <el-col :span="8">
  82. <el-form-item label="小程序页面地址" required label-width="140px">
  83. <el-input v-model="form.miniAppPath" placeholder="请输入小程序页面地址"></el-input>
  84. </el-form-item>
  85. </el-col>
  86. </el-row>
  87. <template v-if="form.source === '银行自有' || form.source === '荣数商品'">
  88. <el-row :gutter="20">
  89. <el-col :span="8">
  90. <el-form-item label="权益名称" required>
  91. <el-input v-model="form.equityName" maxlength="40" placeholder="请输入权益名称"></el-input>
  92. </el-form-item>
  93. </el-col>
  94. <el-col :span="8">
  95. <el-form-item label="权益副标题">
  96. <el-input v-model="form.subTitle" maxlength="40" placeholder="请输入权益副标题"></el-input>
  97. </el-form-item>
  98. </el-col>
  99. </el-row>
  100. <el-row :gutter="20" v-if="form.source === '荣数商品'">
  101. <el-col :span="8">
  102. <el-form-item label="库存数" required>
  103. <el-input-number
  104. v-model="form.stockCount"
  105. :min="0"
  106. :max="100000"
  107. style="width: 100%"
  108. ></el-input-number>
  109. </el-form-item>
  110. </el-col>
  111. </el-row>
  112. <el-row :gutter="20">
  113. <el-col :span="8">
  114. <el-form-item required>
  115. <span slot="label">权益图标
  116. <el-tooltip content="展示在权益首页和权益列表页" placement="top">
  117. <i class="el-icon-question tip-icon"></i>
  118. </el-tooltip>
  119. </span>
  120. <el-upload
  121. action=""
  122. :auto-upload="false"
  123. :file-list="form.listIcon"
  124. :on-change="file => handleUpload(file, 'listIcon')"
  125. :on-preview="handlePreviewImage"
  126. :on-remove="() => form.listIcon = []"
  127. :class="{ 'upload-hide-trigger': form.listIcon.length >= 1 }"
  128. :limit="1"
  129. list-type="picture-card"
  130. >
  131. <i class="el-icon-plus"></i>
  132. </el-upload>
  133. <div class="upload-size-tip">建议尺寸:80x80px</div>
  134. </el-form-item>
  135. </el-col>
  136. </el-row>
  137. </template>
  138. <template v-else-if="form.source === '第三方'">
  139. <el-row :gutter="20">
  140. <el-col :span="8">
  141. <el-form-item label="权益名称" required>
  142. <el-input v-model="form.equityName" maxlength="40" placeholder="请输入权益名称"></el-input>
  143. </el-form-item>
  144. </el-col>
  145. <el-col :span="8">
  146. <el-form-item label="权益副标题">
  147. <el-input v-model="form.subTitle" maxlength="40" placeholder="请输入权益副标题"></el-input>
  148. </el-form-item>
  149. </el-col>
  150. </el-row>
  151. <el-row :gutter="20" v-if="form.externalJumpMethod === '没有'">
  152. <el-col :span="8">
  153. <el-form-item required>
  154. <span slot="label">权益图标
  155. <el-tooltip content="展示在权益首页和权益列表页" placement="top">
  156. <i class="el-icon-question tip-icon"></i>
  157. </el-tooltip>
  158. </span>
  159. <el-upload
  160. action=""
  161. :auto-upload="false"
  162. :file-list="form.listIcon"
  163. :on-change="file => handleUpload(file, 'listIcon')"
  164. :on-preview="handlePreviewImage"
  165. :on-remove="() => form.listIcon = []"
  166. :class="{ 'upload-hide-trigger': form.listIcon.length >= 1 }"
  167. :limit="1"
  168. list-type="picture-card"
  169. >
  170. <i class="el-icon-plus"></i>
  171. </el-upload>
  172. <div class="upload-size-tip">建议尺寸:80x80px</div>
  173. </el-form-item>
  174. </el-col>
  175. </el-row>
  176. <el-row v-if="form.externalJumpMethod === '有'" :gutter="20">
  177. <el-col :span="8">
  178. <el-form-item required>
  179. <span slot="label">权益图标
  180. <el-tooltip content="展示在权益首页和权益列表页" placement="top">
  181. <i class="el-icon-question tip-icon"></i>
  182. </el-tooltip>
  183. </span>
  184. <el-upload
  185. action=""
  186. :auto-upload="false"
  187. :file-list="form.listIcon"
  188. :on-change="file => handleUpload(file, 'listIcon')"
  189. :on-preview="handlePreviewImage"
  190. :on-remove="() => form.listIcon = []"
  191. :class="{ 'upload-hide-trigger': form.listIcon.length >= 1 }"
  192. :limit="1"
  193. list-type="picture-card"
  194. >
  195. <i class="el-icon-plus"></i>
  196. </el-upload>
  197. <div class="upload-size-tip">建议尺寸:80x80px</div>
  198. </el-form-item>
  199. </el-col>
  200. </el-row>
  201. </template>
  202. </el-form>
  203. </el-card>
  204. <!-- 详情信息 -->
  205. <el-card v-if="shouldShowDetailCard" shadow="never" class="section-card">
  206. <div slot="header" class="section-title">详情信息</div>
  207. <el-form :model="form" label-width="120px" label-position="left">
  208. <el-row :gutter="20">
  209. <el-col :span="8">
  210. <el-form-item label="权益主图" required>
  211. <el-upload
  212. action=""
  213. :auto-upload="false"
  214. :file-list="form.mainImage"
  215. :on-change="file => handleUpload(file, 'mainImage')"
  216. :on-preview="handlePreviewImage"
  217. :on-remove="() => form.mainImage = []"
  218. :class="{ 'upload-hide-trigger': form.mainImage.length >= 1 }"
  219. :limit="1"
  220. list-type="picture-card"
  221. >
  222. <i class="el-icon-plus"></i>
  223. </el-upload>
  224. <div class="upload-size-tip">建议尺寸:716x400px</div>
  225. </el-form-item>
  226. </el-col>
  227. </el-row>
  228. <el-row :gutter="20">
  229. <el-col :span="12">
  230. <el-form-item label="权益介绍" required>
  231. <el-input
  232. v-model="form.introduction"
  233. type="textarea"
  234. :rows="4"
  235. maxlength="500"
  236. show-word-limit
  237. placeholder="请输入权益介绍"
  238. ></el-input>
  239. </el-form-item>
  240. </el-col>
  241. </el-row>
  242. <el-row :gutter="20">
  243. <el-col :span="12">
  244. <el-form-item label="权益内容" required>
  245. <quill-editor v-model="form.overview" :options="quillOptions"></quill-editor>
  246. </el-form-item>
  247. </el-col>
  248. <el-col :span="12">
  249. <el-form-item label="权益说明" required>
  250. <quill-editor v-model="form.details" :options="quillOptions"></quill-editor>
  251. </el-form-item>
  252. </el-col>
  253. </el-row>
  254. <template v-if="form.source === '银行自有' || form.source === '荣数商品'">
  255. <el-row :gutter="20">
  256. <el-col :span="24">
  257. <el-form-item>
  258. <span slot="label">下单成功短信
  259. <el-tooltip placement="top">
  260. <div slot="content">
  261. 此模板为权益支付成功,发送给持卡人的短信模板;<br/>
  262. 开启后需选择短信模板,关闭则不发送短信。<br/>
  263. 占位符如下:<br/>
  264. 权益名称:${productName}<br/>
  265. 结束日期:${expireDate}<br/>
  266. 卡号:${exchangeNum}<br/>
  267. 卡密:${exchangePwd}<br/>
  268. 券码路径:${qrCodeDownPaths}
  269. </div>
  270. <i class="el-icon-question tip-icon"></i>
  271. </el-tooltip>
  272. </span>
  273. <el-switch v-model="form.smsEnabled" @change="handleSmsEnabledChange"></el-switch>
  274. <template v-if="form.smsEnabled">
  275. <div style="width: 600px;background: #f1f2f5;padding: 20px;margin-top: 10px;">
  276. <el-select
  277. v-model="form.smsTemplateId"
  278. placeholder="请选择短信模板"
  279. style="width: 100%"
  280. @change="handleSmsTemplateChange"
  281. >
  282. <el-option
  283. v-for="item in smsTemplateOptions"
  284. :key="item.id"
  285. :label="item.name"
  286. :value="item.id"
  287. />
  288. </el-select>
  289. <div v-if="form.smsTemplate" class="sms-template-preview">{{ form.smsTemplate }}</div>
  290. </div>
  291. </template>
  292. </el-form-item>
  293. </el-col>
  294. </el-row>
  295. <el-row :gutter="20">
  296. <el-col :span="8">
  297. <el-form-item label="领取成功按钮" required>
  298. <el-input v-model="form.successButtonText" placeholder="请输入按钮文案"></el-input>
  299. </el-form-item>
  300. </el-col>
  301. </el-row>
  302. </template>
  303. </el-form>
  304. </el-card>
  305. </div>
  306. <div v-show="activeStep === 1">
  307. <!-- 设置规则 -->
  308. <el-card shadow="never" class="section-card">
  309. <div slot="header" class="section-title">设置规则</div>
  310. <div slot="header" class="section-title">展示规则</div>
  311. <el-form :model="form" label-width="120px" label-position="left">
  312. <el-form-item label="展示时间限制">
  313. <el-switch v-model="form.showTimeEnabled"></el-switch>
  314. <template v-if="form.showTimeEnabled">
  315. <div style="display: flex;width: 600px;background: #f1f2f5;padding: 20px;margin-top: 10px;">
  316. <el-date-picker
  317. v-model="form.showStartTime"
  318. type="datetime"
  319. placeholder="请选择开始时间"
  320. format="yyyy-MM-dd HH:mm:ss"
  321. value-format="yyyy-MM-dd HH:mm:ss"
  322. style="width: 100%"
  323. ></el-date-picker>
  324. <div style="width: 50px;text-align: center;">-</div>
  325. <el-date-picker
  326. v-model="form.showEndTime"
  327. type="datetime"
  328. placeholder="请选择结束时间"
  329. format="yyyy-MM-dd HH:mm:ss"
  330. value-format="yyyy-MM-dd HH:mm:ss"
  331. style="width: 100%"
  332. ></el-date-picker>
  333. </div>
  334. </template>
  335. </el-form-item>
  336. <el-form-item label="展示客群限制">
  337. <el-switch v-model="form.showGroupEnabled"></el-switch>
  338. <template v-if="form.showGroupEnabled">
  339. <div style="display: flex;width: 600px;background: #f1f2f5;padding: 20px;margin-top: 10px;">
  340. <el-select v-model="form.showGroupTagIds" multiple filterable placeholder="请选择客群" style="width: 100%">
  341. <el-option label="客群A" value="客群A"></el-option>
  342. <el-option label="客群B" value="客群B"></el-option>
  343. <el-option label="客群C" value="客群C"></el-option>
  344. </el-select>
  345. </div>
  346. </template>
  347. </el-form-item>
  348. </el-form>
  349. </el-card>
  350. <!-- 领取规则 -->
  351. <el-card shadow="never" class="section-card">
  352. <div slot="header" class="section-title">领取规则</div>
  353. <el-form :model="form" label-width="120px" label-position="left">
  354. <el-form-item label="领取时间限制">
  355. <el-switch v-model="form.claimTimeEnabled"></el-switch>
  356. <template v-if="form.claimTimeEnabled">
  357. <div style="display: flex;width: 600px;background: #f1f2f5;padding: 20px;margin-top: 10px;">
  358. <el-date-picker
  359. v-model="form.claimStartTime"
  360. type="datetime"
  361. placeholder="请选择开始时间"
  362. format="yyyy-MM-dd HH:mm:ss"
  363. value-format="yyyy-MM-dd HH:mm:ss"
  364. style="width: 100%"
  365. ></el-date-picker>
  366. <div style="width: 50px;text-align: center;">-</div>
  367. <el-date-picker
  368. v-model="form.claimEndTime"
  369. type="datetime"
  370. placeholder="请选择结束时间"
  371. format="yyyy-MM-dd HH:mm:ss"
  372. value-format="yyyy-MM-dd HH:mm:ss"
  373. style="width: 100%"
  374. ></el-date-picker>
  375. </div>
  376. </template>
  377. </el-form-item>
  378. <el-form-item label="领取客群限制">
  379. <el-switch v-model="form.claimGroupEnabled"></el-switch>
  380. <template v-if="form.claimGroupEnabled">
  381. <div style="width: 600px;background: #f1f2f5;padding: 20px;margin-top: 10px;">
  382. <el-alert
  383. title="需在【权益管理-权益发放】中选择权益发放,未发放的权益移动端不展示"
  384. type="info"
  385. :closable="false"
  386. show-icon
  387. style="margin-bottom: 12px;"
  388. ></el-alert>
  389. <div style="font-size: 14px;color: #606266;margin-bottom: 8px;font-weight: 500;">不满足提示</div>
  390. <el-form-item label="提示内容" label-width="80px" style="margin-bottom: 12px;">
  391. <el-input v-model="form.claimDenyMessage" maxlength="200" placeholder="请输入提示内容"></el-input>
  392. </el-form-item>
  393. <el-form-item label="跳转按钮文案" label-width="100px" style="margin-bottom: 12px;">
  394. <el-input v-model="form.claimDenyButtonText" maxlength="10" placeholder="请输入按钮文案"></el-input>
  395. </el-form-item>
  396. <el-form-item label="跳转按钮链接" label-width="100px" style="margin-bottom: 0;">
  397. <el-input v-model="form.claimDenyButtonLink" maxlength="200" placeholder="请输入按钮链接"></el-input>
  398. </el-form-item>
  399. </div>
  400. </template>
  401. </el-form-item>
  402. </el-form>
  403. </el-card>
  404. </div>
  405. <div v-show="activeStep === 2">
  406. <!-- 显示页面 -->
  407. <el-card shadow="never" class="section-card">
  408. <div slot="header" class="section-title">显示页面</div>
  409. <el-form :model="form" label-width="120px" label-position="left">
  410. <el-form-item label="权益首页/列表页">
  411. <el-radio-group v-model="form.showOnHome">
  412. <el-radio label="显示">显示</el-radio>
  413. <el-radio label="不显示">不显示</el-radio>
  414. </el-radio-group>
  415. </el-form-item>
  416. <el-form-item label="组装页">
  417. <el-radio-group v-model="form.showOnAssembly">
  418. <el-radio label="显示">显示</el-radio>
  419. <el-radio label="不显示">不显示</el-radio>
  420. </el-radio-group>
  421. <div
  422. v-if="form.showOnAssembly === '显示'"
  423. style="width: 600px;background: #f1f2f5;padding: 20px;margin-top: 10px;"
  424. >
  425. <el-select
  426. v-model="form.assemblyPages"
  427. multiple
  428. filterable
  429. placeholder="请选择组装页"
  430. style="width: 100%"
  431. >
  432. <el-option label="组装页A" value="组装页A"></el-option>
  433. <el-option label="组装页B" value="组装页B"></el-option>
  434. <el-option label="组装页C" value="组装页C"></el-option>
  435. <el-option label="组装页D" value="组装页D"></el-option>
  436. </el-select>
  437. </div>
  438. </el-form-item>
  439. </el-form>
  440. </el-card>
  441. <!-- 分享设置 -->
  442. <el-card shadow="never" class="section-card">
  443. <div slot="header" class="section-title">分享设置</div>
  444. <el-form :model="form" label-width="120px" label-position="left">
  445. <el-form-item label="是否支持分享">
  446. <el-switch v-model="form.shareEnabled" @change="handleShareEnabledChange"></el-switch>
  447. <template v-if="form.shareEnabled">
  448. <div style="width: 600px;background: #f1f2f5;padding: 20px;margin-top: 10px;">
  449. <el-form-item label="分享名称" label-width="100px" required style="margin-bottom: 16px;">
  450. <el-input
  451. v-model="form.shareName"
  452. maxlength="40"
  453. placeholder="请输入分享名称"
  454. ></el-input>
  455. </el-form-item>
  456. <el-form-item label="分享图片" label-width="100px" required style="margin-bottom: 0;">
  457. <el-upload
  458. action=""
  459. :auto-upload="false"
  460. :file-list="form.shareImage"
  461. :on-change="file => handleUpload(file, 'shareImage')"
  462. :limit="1"
  463. list-type="picture-card"
  464. >
  465. <i class="el-icon-plus"></i>
  466. </el-upload>
  467. </el-form-item>
  468. </div>
  469. </template>
  470. </el-form-item>
  471. </el-form>
  472. </el-card>
  473. </div>
  474. <!-- 操作栏 -->
  475. <div class="action-bar">
  476. <div class="action-left">
  477. <el-button
  478. v-if="activeStep > 0"
  479. @click="prevStep"
  480. icon="el-icon-arrow-left"
  481. >上一步</el-button>
  482. </div>
  483. <div class="action-center">
  484. <template v-if="activeStep === 2">
  485. <el-button type="primary" @click="handleSubmit">保存</el-button>
  486. <el-button @click="goBack">取消</el-button>
  487. </template>
  488. </div>
  489. <div class="action-right">
  490. <el-button
  491. v-if="activeStep < 2"
  492. type="primary"
  493. @click="nextStep"
  494. >下一步<i class="el-icon-arrow-right el-icon--right"></i></el-button>
  495. </div>
  496. </div>
  497. </el-card>
  498. <rongshu-product-dialog
  499. :visible.sync="rongshuDialogVisible"
  500. @select="onRongshuSelect"
  501. />
  502. <el-dialog :visible.sync="previewVisible" title="图片预览" width="640px" append-to-body>
  503. <img v-if="previewImageUrl" :src="previewImageUrl" style="display:block; max-width:100%; margin:0 auto;" />
  504. </el-dialog>
  505. </div>
  506. </template>
  507. <script>
  508. import RongshuProductDialog from '@/components/RongshuProductDialog.vue'
  509. export default {
  510. name: 'EditEquityProduct',
  511. components: { RongshuProductDialog },
  512. data() {
  513. return {
  514. activeStep: 0,
  515. rongshuDialogVisible: false,
  516. previewVisible: false,
  517. previewImageUrl: '',
  518. quillOptions: {
  519. placeholder: '请输入内容...',
  520. modules: {
  521. toolbar: [
  522. ['bold', 'italic', 'underline'],
  523. [{ list: 'ordered' }, { list: 'bullet' }],
  524. [{ header: [1, 2, 3, false] }],
  525. ['link', 'image'],
  526. ['clean']
  527. ]
  528. }
  529. },
  530. smsTemplateOptions: [
  531. { id: 'SMS_TPL_001', name: '通用权益支付成功模板', content: '【银行】您购买的${productName}已支付成功,卡号:${exchangeNum},卡密:${exchangePwd},有效期至${expireDate},详情:${qrCodeDownPaths}' },
  532. { id: 'SMS_TPL_002', name: '券码类短信模板', content: '【银行】尊敬的客户,您的${productName}购买成功,券码为${exchangeNum},请于${expireDate}前使用。' },
  533. { id: 'SMS_TPL_003', name: '实物类短信模板', content: '【银行】您购买的${productName}已受理,我们将尽快安排发货,感谢您的支持。' }
  534. ],
  535. form: {
  536. source: '银行自有',
  537. rongshuProduct: '',
  538. productType: '券码',
  539. faceValueThreshold: '',
  540. faceValueDiscount: '',
  541. stockCount: null,
  542. shareEnabled: false,
  543. shareImage: [],
  544. shareName: '',
  545. externalJumpMethod: '没有',
  546. externalLink: '太古地产',
  547. customLink: '',
  548. miniAppId: '',
  549. miniAppPath: '',
  550. skuNo: '',
  551. equityName: '',
  552. productId: '',
  553. merchantName: '',
  554. subTitle: '',
  555. listIcon: [],
  556. mainImage: [],
  557. introduction: '',
  558. overview: '',
  559. details: '',
  560. smsEnabled: false,
  561. smsTemplateId: '',
  562. smsTemplate: '',
  563. successButtonText: '',
  564. showTimeEnabled: false,
  565. showStartTime: '',
  566. showEndTime: '',
  567. showGroupEnabled: false,
  568. showGroupTagIds: [],
  569. claimTimeEnabled: false,
  570. claimStartTime: '',
  571. claimEndTime: '',
  572. claimGroupEnabled: false,
  573. claimGroupIsPotential: false,
  574. claimGroupTagId: '',
  575. claimDenyMessage: '',
  576. claimDenyButtonText: '',
  577. claimDenyButtonLink: '',
  578. showOnHome: '显示',
  579. showOnAssembly: '不显示',
  580. assemblyPages: []
  581. }
  582. }
  583. },
  584. computed: {
  585. shouldShowDetailCard() {
  586. const s = this.form.source
  587. if (s === '银行自有' || s === '荣数商品') return true
  588. if (s === '第三方' && this.form.externalJumpMethod === '有') return true
  589. return false
  590. }
  591. },
  592. created() {
  593. this.loadData()
  594. },
  595. methods: {
  596. loadData() {
  597. const id = this.$route.params.id
  598. const mockMap = {
  599. 100001: {
  600. source: '银行自有',
  601. externalJumpMethod: '',
  602. externalLink: '',
  603. customLink: '',
  604. miniAppId: '',
  605. miniAppPath: '',
  606. skuNo: 'SKU001',
  607. equityName: '权益A',
  608. subTitle: '副标题示例',
  609. listIcon: [],
  610. mainImage: [],
  611. overview: '<p>权益内容内容</p>',
  612. details: '<p>权益说明内容</p>',
  613. smsEnabled: true,
  614. smsTemplateId: 'SMS_TPL_001',
  615. smsTemplate: '【银行】您购买的${productName}已支付成功,卡号:${exchangeNum},卡密:${exchangePwd},有效期至${expireDate},详情:${qrCodeDownPaths}',
  616. successButtonText: '马上去使用',
  617. showTimeEnabled: true,
  618. showStartTime: '2026-01-01 00:00:00',
  619. showEndTime: '2026-12-31 23:59:59',
  620. showGroupEnabled: false,
  621. showGroupTagIds: [],
  622. claimTimeEnabled: true,
  623. claimStartTime: '2026-01-01 00:00:00',
  624. claimEndTime: '2026-12-31 23:59:59',
  625. claimGroupEnabled: false,
  626. claimGroupTagId: '',
  627. claimDenyMessage: '',
  628. claimDenyButtonText: '',
  629. claimDenyButtonLink: ''
  630. },
  631. 100002: {
  632. source: '第三方',
  633. externalJumpMethod: '没有',
  634. externalLink: '太古地产',
  635. customLink: '',
  636. miniAppId: '',
  637. miniAppPath: '',
  638. skuNo: 'SKU002',
  639. equityName: '权益B',
  640. subTitle: '外部列表页副标题',
  641. listIcon: [],
  642. mainImage: [],
  643. overview: '',
  644. details: '',
  645. smsEnabled: false,
  646. smsTemplateId: '',
  647. smsTemplate: '',
  648. successButtonText: '',
  649. showTimeEnabled: false,
  650. showStartTime: '',
  651. showEndTime: '',
  652. showGroupEnabled: true,
  653. showGroupTagIds: ['客群A'],
  654. claimTimeEnabled: true,
  655. claimStartTime: '2026-02-01 00:00:00',
  656. claimEndTime: '2026-11-30 23:59:59',
  657. claimGroupEnabled: true,
  658. claimGroupIsPotential: false,
  659. claimGroupTagId: '客群奖励活动A',
  660. claimDenyMessage: '您暂不满足领取条件',
  661. claimDenyButtonText: '去升级',
  662. claimDenyButtonLink: 'https://example.com/upgrade'
  663. },
  664. 100003: {
  665. source: '第三方',
  666. externalJumpMethod: '有',
  667. externalLink: '龙腾',
  668. customLink: '',
  669. miniAppId: '',
  670. miniAppPath: '',
  671. skuNo: 'SKU003',
  672. equityName: '权益C',
  673. subTitle: '外部详情页副标题',
  674. listIcon: [],
  675. mainImage: [],
  676. overview: '<p>外部详情页权益内容</p>',
  677. details: '<p>外部详情页权益说明</p>',
  678. smsEnabled: false,
  679. smsTemplateId: '',
  680. smsTemplate: '',
  681. successButtonText: '',
  682. showTimeEnabled: false,
  683. showStartTime: '',
  684. showEndTime: '',
  685. showGroupEnabled: false,
  686. showGroupTagIds: [],
  687. claimTimeEnabled: false,
  688. claimStartTime: '',
  689. claimEndTime: '',
  690. claimGroupEnabled: false,
  691. claimGroupTagId: '',
  692. claimDenyMessage: '',
  693. claimDenyButtonText: '',
  694. claimDenyButtonLink: ''
  695. },
  696. 100004: {
  697. source: '第三方',
  698. externalJumpMethod: '有',
  699. externalLink: 'h5链接',
  700. customLink: 'https://example.com/custom',
  701. skuNo: 'SKU004',
  702. equityName: '权益D',
  703. subTitle: '外部自定义链接副标题',
  704. listIcon: [],
  705. mainImage: [],
  706. overview: '<p>自定义链接权益内容</p>',
  707. details: '<p>自定义链接权益说明</p>',
  708. smsEnabled: false,
  709. smsTemplateId: '',
  710. smsTemplate: '',
  711. successButtonText: '',
  712. showTimeEnabled: false,
  713. showStartTime: '',
  714. showEndTime: '',
  715. showGroupEnabled: false,
  716. showGroupTagIds: [],
  717. claimTimeEnabled: false,
  718. claimStartTime: '',
  719. claimEndTime: '',
  720. claimGroupEnabled: false,
  721. claimGroupTagId: '',
  722. claimDenyMessage: '',
  723. claimDenyButtonText: '',
  724. claimDenyButtonLink: ''
  725. }
  726. }
  727. if (id && mockMap[id]) {
  728. Object.assign(this.form, mockMap[id])
  729. }
  730. },
  731. nextStep() {
  732. if (this.activeStep < 2) {
  733. this.activeStep++
  734. }
  735. },
  736. prevStep() {
  737. if (this.activeStep > 0) {
  738. this.activeStep--
  739. }
  740. },
  741. handleSubmit() {
  742. this.$message.success('保存成功')
  743. this.$router.push('/customization/hsbc/equity-products')
  744. },
  745. goBack() {
  746. this.$router.push('/customization/hsbc/equity-products')
  747. },
  748. handleSmsEnabledChange(val) {
  749. if (!val) {
  750. this.form.smsTemplateId = ''
  751. this.form.smsTemplate = ''
  752. }
  753. },
  754. handleShareEnabledChange(val) {
  755. if (val) {
  756. if (!this.form.shareName) {
  757. this.form.shareName = this.form.equityName || ''
  758. }
  759. }
  760. },
  761. handleSmsTemplateChange(id) {
  762. const tpl = this.smsTemplateOptions.find(i => i.id === id)
  763. this.form.smsTemplate = tpl ? tpl.content : ''
  764. },
  765. handleUpload(file, field) {
  766. if (!file || !file.raw) return
  767. const reader = new FileReader()
  768. reader.onload = (e) => {
  769. this.form[field] = [{ name: file.name, url: e.target.result, uid: file.uid }]
  770. }
  771. reader.readAsDataURL(file.raw)
  772. },
  773. handlePreviewImage(file) {
  774. this.previewImageUrl = file.url || ''
  775. this.previewVisible = !!this.previewImageUrl
  776. },
  777. onRongshuSelect(product) {
  778. this.form.rongshuProduct = product.name
  779. this.form.equityName = product.name
  780. this.form.merchantName = product.merchant
  781. this.form.stockCount = product.stock
  782. this.form.mainImage = product.mainImage ? [...product.mainImage] : []
  783. }
  784. }
  785. }
  786. </script>
  787. <style scoped>
  788. .edit-equity-product {
  789. padding: 20px;
  790. }
  791. .header-title {
  792. font-size: 18px;
  793. font-weight: 500;
  794. }
  795. .section-card {
  796. margin-bottom: 16px;
  797. border: none;
  798. }
  799. .upload-hide-trigger >>> .el-upload--picture-card { display: none; }
  800. .section-card >>> .el-card__header {
  801. padding: 12px 20px;
  802. background: #fafafa;
  803. border-bottom: 1px solid #ebeef5;
  804. }
  805. .section-title {
  806. font-size: 16px;
  807. font-weight: 600;
  808. color: #303133;
  809. }
  810. .action-bar {
  811. display: flex;
  812. align-items: center;
  813. justify-content: space-between;
  814. margin-top: 20px;
  815. padding-top: 20px;
  816. border-top: 1px solid #ebeef5;
  817. }
  818. .action-left, .action-right {
  819. width: 120px;
  820. }
  821. .action-center {
  822. display: flex;
  823. justify-content: center;
  824. gap: 12px;
  825. }
  826. .tip-icon {
  827. color: #909399;
  828. cursor: pointer;
  829. font-size: 14px;
  830. }
  831. .upload-size-tip {
  832. margin-top: 4px;
  833. font-size: 12px;
  834. color: #909399;
  835. line-height: 1.5;
  836. }
  837. .sms-template-preview {
  838. margin-top: 12px;
  839. padding: 12px;
  840. background: #fff;
  841. border: 1px dashed #dcdfe6;
  842. border-radius: 4px;
  843. font-size: 13px;
  844. color: #606266;
  845. line-height: 1.6;
  846. white-space: pre-wrap;
  847. word-break: break-all;
  848. }
  849. </style>