platform.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. {include file="/shopro/common/script" /}
  2. <style>
  3. .config-platform .el-select {
  4. flex: 1;
  5. }
  6. .config-platform .title {
  7. width: 100%;
  8. padding: 10px 0 10px 16px;
  9. background: var(--sa-background-hex-hover);
  10. font-weight: 500;
  11. font-size: 14px;
  12. color: var(--sa-subtitle);
  13. margin: 0 0 16px;
  14. display: flex;
  15. align-items: center;
  16. }
  17. .config-platform .title-h5 {
  18. margin-left: 20px;
  19. }
  20. .config-platform .pay-tip {
  21. font-weight: 400;
  22. font-size: 14px;
  23. line-height: 20px;
  24. color: var(--sa-subtitle);
  25. margin-left: 16px;
  26. }
  27. </style>
  28. <div id="platform" class="config-platform" v-cloak>
  29. <el-container class="panel-block">
  30. <el-main>
  31. <el-scrollbar height="100%">
  32. <el-form ref="formRef" :model="form.model" :rules="form.rules" label-width="100px">
  33. <div class="title">状态</div>
  34. <el-form-item label="状态">
  35. <el-switch v-model="form.model.status" :active-value="1" :inactive-value="0"></el-switch>
  36. <span class="label-tip" :class="form.model.status == 1 ? 'sa-color--primary' : ''">
  37. {{form.model.status == 0 ? '关闭' : '开启'}}</span>
  38. </el-form-item>
  39. <div class="title">支付配置<span class="pay-tip">启用货到付款后,请自行安排合作快递完成收款和结算</span> </div>
  40. <el-form-item label="支付方式">
  41. <el-checkbox-group v-model="form.model.payment.methods">
  42. <el-checkbox label="wechat">微信</el-checkbox>
  43. <el-checkbox label="alipay">支付宝</el-checkbox>
  44. <el-checkbox label="money">余额</el-checkbox>
  45. <el-checkbox label="offline">货到付款</el-checkbox>
  46. </el-checkbox-group>
  47. </el-form-item>
  48. <el-form-item v-if="form.model.payment.methods.includes('wechat')" label="微信" prop="payment.wechat">
  49. <div class="sa-w-360">
  50. <el-select v-model="form.model.payment.wechat" placeholder="请选择">
  51. <el-option v-for="item in payConfig.select.wechat" :key="item.id" :label="item.name"
  52. :value="item.id">
  53. </el-option>
  54. </el-select>
  55. <el-button class="label-tip" type="primary" link @click="onAddPayConfig"> 添加支付方式
  56. </el-button>
  57. </div>
  58. </el-form-item>
  59. <el-form-item v-if="form.model.payment.methods.includes('alipay')" label="支付宝"
  60. prop="payment.alipay">
  61. <div class="sa-w-360">
  62. <el-select v-model="form.model.payment.alipay" placeholder="请选择">
  63. <el-option v-for="item in payConfig.select.alipay" :key="item.id" :label="item.name"
  64. :value="item.id">
  65. </el-option>
  66. </el-select>
  67. <el-button class="label-tip" type="primary" link @click="onAddPayConfig"> 添加支付方式
  68. </el-button>
  69. </div>
  70. </el-form-item>
  71. <div class="title">
  72. {{state.platform == 'H5' ? '微信H5' : state.label}}平台设置
  73. <div v-if="state.platform == 'H5'" class="title-h5">
  74. 如使用微信支付,请在此输入已开通微信H5支付的Appid
  75. </div>
  76. </div>
  77. <el-form-item label="Appid" prop="app_id">
  78. <div class="sa-w-360">
  79. <el-input v-model="form.model.app_id" placeholder="请输入Appid"></el-input>
  80. <el-button v-if="state.platform=='H5' || state.platform=='App'" class="label-tip"
  81. type="primary" link @click="onConfiguration">查看配置引导</el-button>
  82. </div>
  83. </el-form-item>
  84. <el-form-item label="AppSecret" prop="secret" v-if="state.platform != 'H5'">
  85. <el-input class="sa-w-360" v-model="form.model.secret" placeholder="请输入AppSecret"></el-input>
  86. </el-form-item>
  87. <div v-if="state.platform != 'H5'">
  88. <div class="title">微信登录设置</div>
  89. <el-form-item v-if="state.platform != 'App'" label="自动登录">
  90. <div class="sa-flex">
  91. <el-switch v-model="form.model.auto_login" :active-value="1" :inactive-value="0">
  92. </el-switch>
  93. <span class="label-tip" :class="form.model.auto_login == 1 ? 'sa-color--primary' : ''">
  94. {{form.model.status == 0 ? '关闭' : '开启'}}</span>
  95. <div class="tip label-tip"> 进入应用后立即自动发起授权登录 </div>
  96. </div>
  97. </el-form-item>
  98. <el-form-item label="绑定手机号">
  99. <div class="sa-flex">
  100. <el-switch v-model="form.model.bind_mobile" :active-value="1" :inactive-value="0">
  101. </el-switch>
  102. <span class="label-tip" :class="form.model.bind_mobile == 1 ? 'sa-color--primary' : ''">
  103. {{form.model.status == 0 ? '关闭' : '开启'}}</span>
  104. <div class="tip label-tip"> 授权登录后立即提醒绑定手机号 </div>
  105. </div>
  106. </el-form-item>
  107. </div>
  108. <div v-if="state.platform == 'App'">
  109. <div class="title">APP下载</div>
  110. <el-form-item label="Android地址">
  111. <el-input class="sa-w-360" v-model="form.model.download.android"
  112. placeholder="请输入Android下载地址"></el-input>
  113. </el-form-item>
  114. <el-form-item label="IOS地址">
  115. <el-input class="sa-w-360" v-model="form.model.download.ios" placeholder="请输入IOS下载地址">
  116. </el-input>
  117. </el-form-item>
  118. <el-form-item label="本地地址">
  119. <el-input class="sa-w-360" v-model="form.model.download.local" placeholder="请输入本地地址">
  120. </el-input>
  121. </el-form-item>
  122. </div>
  123. <template v-if="form.model.share">
  124. <div class="title">分享设置</div>
  125. <el-form-item label="分享方式">
  126. <el-checkbox-group v-model="form.model.share.methods">
  127. <el-checkbox label="forward" disabled>直接转发</el-checkbox>
  128. <el-checkbox label="poster">分享海报</el-checkbox>
  129. <el-checkbox label="link">复制链接</el-checkbox>
  130. </el-checkbox-group>
  131. </el-form-item>
  132. <template v-if="form.model.share.methods.includes('forward')">
  133. <el-form-item label="标题">
  134. <el-input class="sa-w-360" v-model="form.model.share.forwardInfo.title"
  135. placeholder="请输入分享标题"></el-input>
  136. </el-form-item>
  137. <el-form-item label="副标题">
  138. <el-input class="sa-w-360" v-model="form.model.share.forwardInfo.subtitle"
  139. placeholder="请输入分享副标题">
  140. </el-input>
  141. </el-form-item>
  142. <el-form-item label="分享图片">
  143. <sa-uploader v-model="form.model.share.forwardInfo.image">
  144. </sa-uploader>
  145. </el-form-item>
  146. </template>
  147. <template v-if="form.model.share.methods.includes('poster')">
  148. <el-form-item label="用户海报">
  149. <sa-uploader v-model="form.model.share.posterInfo.user_bg">
  150. </sa-uploader>
  151. </el-form-item>
  152. <el-form-item label="商品海报">
  153. <sa-uploader v-model="form.model.share.posterInfo.goods_bg">
  154. </sa-uploader>
  155. </el-form-item>
  156. <el-form-item label="拼团海报">
  157. <sa-uploader v-model="form.model.share.posterInfo.groupon_bg">
  158. </sa-uploader>
  159. </el-form-item>
  160. </template>
  161. <el-form-item label="分享Url">
  162. <div class="sa-form-wrap">
  163. <el-input class="sa-w-360" v-model="form.model.share.linkAddress"
  164. placeholder="请输入分享Url"></el-input>
  165. <div class="tip">分享链接的默认域名</div>
  166. </div>
  167. </el-form-item>
  168. </template>
  169. </el-form>
  170. </el-scrollbar>
  171. </el-main>
  172. <el-footer class="sa-footer--submit sa-flex sa-row-right">
  173. <el-button type="primary" @click="onConfirm">确定</el-button>
  174. </el-footer>
  175. </el-container>
  176. </div>