partnerCenter.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. <template>
  2. <view class="container">
  3. <form @submit="onSubmit">
  4. <view class="page-block">
  5. <view class="page-title-block"></view>
  6. <view class="content">
  7. <view class="cell flex flex-y-center">
  8. <view class="title-block">
  9. <text>业务开通状态</text>
  10. </view>
  11. <view class="desc">
  12. <text style="color: red;">
  13. <block v-if="openType == 1">已开通</block>
  14. <block v-else>未开通</block>
  15. </text>
  16. </view>
  17. </view>
  18. <view class="cell flex flex-y-center">
  19. <view class="title-block">
  20. <text>分佣方式</text>
  21. </view>
  22. <view class="desc flex-center ">
  23. <view class="checklist-box " @click="chooseFy(index)" v-for="(item,index) of fyway_arr"
  24. :key='index' :class="fyIndex==index?'actt':''">
  25. <view class="radio__inner" :class="fyIndex==index?'act_border':''">
  26. <view :class="fyIndex==index?'is-default-checked':''"
  27. class="radio__inner-icon radio__inner-icon ">
  28. </view>
  29. </view>
  30. <text class="checklist-text">{{item}}</text>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="cell flex flex-y-center" v-show="fyIndex == 0">
  35. <view class="title-block required">
  36. <text>订单分佣比例</text>
  37. </view>
  38. <view class="desc">
  39. <input type="digit" name="proportion" :value="info.proportion" class="input-box"
  40. placeholder="请输入订单分佣比例" placeholder-class="desc-placeholder">
  41. </view>
  42. </view>
  43. <view class="red" v-show="fyIndex == 0">
  44. *订单分佣比例%
  45. </view>
  46. <view class="cell flex flex-y-center">
  47. <view class="title-block required">
  48. <text>消费门槛</text>
  49. </view>
  50. <view class="desc">
  51. <input type="digit" name="consumption" :value="info.consumption" class="input-box"
  52. placeholder="请输入消费门槛" placeholder-class="desc-placeholder">
  53. </view>
  54. </view>
  55. <view class="red">
  56. *合伙人自己每消费满x元,获赠1份邀请礼盒
  57. </view>
  58. <view class="cell flex flex-y-center">
  59. <view class="title-block">
  60. <text>扣除手续费后进行分佣</text>
  61. </view>
  62. <view class="desc flex-center ">
  63. <view class="checklist-box " @click="choiceFlowers(index)"
  64. v-for="(item,index) of deductFy_arr" :key='index' :class="cost==index?'actt':''">
  65. <view class="radio__inner" :class="cost==index?'act_border':''">
  66. <view :class="cost==index?'is-default-checked':''"
  67. class="radio__inner-icon radio__inner-icon ">
  68. </view>
  69. </view>
  70. <text class="checklist-text">{{item}}</text>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="cell flex flex-y-center" v-show="cost == 0">
  75. <view class="title-block required">
  76. <text>流水分佣手续费</text>
  77. </view>
  78. <view class="desc">
  79. <input type="digit" name="is_rate_bili" :value="info.is_rate_bili" class="input-box"
  80. placeholder="请输入流水分佣手续费" placeholder-class="desc-placeholder">
  81. </view>
  82. </view>
  83. <view class="red" v-show="cost == 0">
  84. *流水分佣手续费比例%
  85. </view>
  86. <view class="cell flex flex-y-center">
  87. <view class="title-block">
  88. <text>充值返佣开关</text>
  89. </view>
  90. <view class="desc flex-center ">
  91. <view class="checklist-box " @click="choicemenber(index)" v-for="(item,index) of ali_arr"
  92. :key='index' :class="is_coupon==index?'actt':''">
  93. <view class="radio__inner" :class="is_coupon==index?'act_border':''">
  94. <view :class="is_coupon==index?'is-default-checked':''"
  95. class="radio__inner-icon radio__inner-icon ">
  96. </view>
  97. </view>
  98. <text class="checklist-text">{{item}}</text>
  99. </view>
  100. </view>
  101. </view>
  102. <view class="cell flex flex-y-center">
  103. <view class="title-block required">
  104. <text>冻结时间(小时)</text>
  105. </view>
  106. <view class="desc">
  107. <input type="digit" name="freezing" :value="info.freezing" class="input-box"
  108. placeholder="请输入冻结时间" placeholder-class="desc-placeholder">
  109. </view>
  110. </view>
  111. <view class="red">
  112. *超过冻结时间,解除冻结金额,解冻金额后方可进行提现,冻结时间之前发生退款会扣除对应用户、合伙人佣金
  113. </view>
  114. <view class="cell flex flex-y-center">
  115. <view class="title-block required">
  116. <text>提现门槛</text>
  117. </view>
  118. <view class="desc">
  119. <input type="digit" name="withdrawal" :value="info.withdrawal" class="input-box"
  120. placeholder="请输入提现门槛" placeholder-class="desc-placeholder">
  121. </view>
  122. </view>
  123. <view class="red">
  124. *合伙人最低可提现的金额,界面显示单位:元
  125. </view>
  126. <view class="cell flex flex-y-center">
  127. <view class="title-block">
  128. <text>打款方式</text>
  129. </view>
  130. <view class=" flex-center ">
  131. <view class="checklist-box " @click="remits(index)" v-for="(item,index) of playManner_arr"
  132. :key='index' :class="playMannerIndex==index?'actt':''">
  133. <view class="radio__inner" :class="playMannerIndex==index?'act_border':''">
  134. <view :class="playMannerIndex==index?'is-default-checked':''"
  135. class="radio__inner-icon radio__inner-icon ">
  136. </view>
  137. </view>
  138. <text class="checklist-text">{{item}}</text>
  139. </view>
  140. </view>
  141. </view>
  142. <view class="red">
  143. *线下打款:分佣方式设置可超过20%,不能超过100%,客户发起提现后,商家线下打款给客户;
  144. </view>
  145. <view class="cell flex flex-y-center">
  146. <view class="title-block required">
  147. <text>分享名称</text>
  148. </view>
  149. <view class="desc">
  150. <input type="digit" name="shared_title" :value="info.shared_title" class="input-box"
  151. placeholder="请填写分享名称" placeholder-class="desc-placeholder">
  152. </view>
  153. </view>
  154. <view class="cell flex flex-y-center box-pack-between" @click="ChooseImage">
  155. <view class="title-block required">
  156. <text>分享图片</text>
  157. </view>
  158. <view class="">
  159. <image mode="aspectFit" class="icon_un_icon" :src="URL+thumb" v-if="thumb"></image>
  160. <image mode="aspectFit" class="icon_un_icon" src="../static/images/icon_18.png" v-else></image>
  161. </view>
  162. </view>
  163. <view class=" page-block" style="background-color: #FFF;padding: 20rpx 25rpx; margin-top: 10px;">
  164. <view class="flex box-pack-between">
  165. <view class="title-block required"
  166. style="font-size: 30rpx;color: #333;font-weight: 600;padding-right: 20rpx;">
  167. <text>合伙人内容</text>
  168. </view>
  169. <view class="flex-center" @click="getEnit">
  170. <text style="color: #007AFF;">{{isrichText?'取消编辑':'编辑'}}</text>
  171. <text class="iconfont icongengduo"></text>
  172. </view>
  173. </view>
  174. <view class="desc">
  175. <view style="padding: 40rpx 0;">
  176. <block v-if="isrichText">
  177. <textarea type="text" maxlength="-1" :value="info.content" name="content"
  178. class="input-box flex-grow-1" placeholder="请输入"
  179. placeholder-class="desc-placeholder"></textarea>
  180. </block>
  181. <block v-else>
  182. <rich-text :nodes="info.content"></rich-text>
  183. <textarea type="text" :value="info.content" name="content" style="display: none;"
  184. class="input-box" placeholder=""
  185. placeholder-class="desc-placeholder"></textarea>
  186. </block>
  187. </view>
  188. </view>
  189. </view>
  190. </view>
  191. </view>
  192. <view style="height:230rpx;"></view>
  193. <button class="sub-btn" hover-class="none" form-type="submit">
  194. 立即提交
  195. </button>
  196. </form>
  197. </view>
  198. </template>
  199. <script>
  200. export default {
  201. data() {
  202. return {
  203. openType: '', //开通情况 /1=已开通,否则未开通
  204. fyway_arr: [
  205. '订单分期',
  206. '商品分期',
  207. '关闭'
  208. ],
  209. fyIndex: 0, //分佣方式索引
  210. deductFy_arr: ['是', '否'],
  211. deductFyIndex: 0,
  212. playManner_arr: ['线下打款','分账打款'],
  213. playMannerIndex: 0,
  214. ali_arr: ['开启', '关闭'],
  215. is_coupon: 0, //充值返佣开关
  216. flowers_arr: ['关闭', '开启'],
  217. cost: 1,
  218. info: {}, //详细参数
  219. isrichText: false, //编辑富文本和显示富文本
  220. URL: getApp().globalData.URL,
  221. thumb:''
  222. }
  223. },
  224. onLoad() {
  225. this.getdata();
  226. },
  227. methods: {
  228. ChooseImage(e) {
  229. let type = e.currentTarget.dataset.type;
  230. uni.chooseImage({
  231. count: 1,
  232. sizeType: ['original', 'compressed'],
  233. sourceType: ['album'], //从相册选择
  234. success: (res) => {
  235. console.log(res)
  236. res.tempFilePaths.forEach((v, i) => {
  237. this.Upload({
  238. url: "Smdcshop/upload",
  239. data: {
  240. url: v,
  241. type: "",
  242. token: "",
  243. admin_id: uni.getStorageSync("admin_id")
  244. }
  245. }).then(res => {
  246. console.log(res, "res")
  247. this.imgid = res.id;
  248. this.thumb = res.src;
  249. }).catch(err => {
  250. uni.showToast({
  251. title: err.message,
  252. icon: 'none'
  253. })
  254. });
  255. })
  256. },
  257. });
  258. },
  259. //选择分佣方式
  260. chooseFy(e) {
  261. this.fyIndex = e;
  262. },
  263. //扣除手续费进行分佣
  264. choiceFlowers(index) {
  265. this.cost = index;
  266. },
  267. //打款
  268. remits(e) {
  269. this.playMannerIndex = e;
  270. },
  271. //返佣充值开关
  272. choicemenber(index) {
  273. this.is_coupon = index;
  274. },
  275. //切换编辑
  276. getEnit() {
  277. this.isrichText = !this.isrichText
  278. },
  279. getdata(e) {
  280. this.request({
  281. url: "smdcshop/shared_setting_info",
  282. data: {
  283. admin_id: uni.getStorageSync("admin_id")
  284. },
  285. }).then(res => {
  286. console.log(res.data, "res")
  287. if (res.code === '200') {
  288. this.thumb = res.data.web_config.shared_img;
  289. this.info = res.data.web_config; //详细
  290. this.openType = res.data.is_shared; //开通情况
  291. this.is_coupon = Number(res.data.web_config.is_commission) - 1; //充值返佣开关 1开启,2关闭
  292. this.fyIndex = Number(res.data.web_config.is_sub_commission) - 1; //分佣方式
  293. this.playMannerIndex = res.data.web_config.pay_type == 3 ? 2 : res.data.web_config.pay_type;
  294. this.playMannerIndex = this.playMannerIndex - 1; //打款方式
  295. this.cost = Number(res.data.web_config.is_rate) - 1; //扣除手续费进行分佣
  296. }
  297. });
  298. },
  299. onSubmit(e) {
  300. let data = e.detail.value;
  301. data.admin_id = uni.getStorageSync("admin_id");
  302. data.id = this.info.id;
  303. data.is_coupon = this.is_coupon;
  304. data.cost = Number(this.cost) + 1;
  305. data.is_sub_commission = Number(this.fyIndex) + 1;
  306. data.is_rate = Number(this.cost) + 1; //扣除手续费后分佣
  307. data.is_commission = Number(this.is_coupon) + 1;
  308. data.pay_type = Number(this.playMannerIndex) + 1;
  309. data.pay_type = data.pay_type == 2? 3:data.pay_type;
  310. data.shared_img = this.thumb;
  311. uni.showModal({
  312. title: '提示',
  313. content: '是否要修改?',
  314. showCancel: true,
  315. cancelText: '取消',
  316. confirmText: '确定',
  317. success: r => {
  318. if (r.confirm) {
  319. this.request({
  320. url: "smdcshop/shared_setting",
  321. data: data,
  322. }).then(res => {
  323. if (res.code == 200) {
  324. uni.showToast({
  325. title: res.message,
  326. icon: 'none'
  327. })
  328. setTimeout(() => {
  329. uni.navigateBack()
  330. }, 2000)
  331. }
  332. }).catch((res) => {
  333. uni.showToast({
  334. title: res.message,
  335. icon: 'none'
  336. })
  337. })
  338. }
  339. }
  340. });
  341. }
  342. }
  343. }
  344. </script>
  345. <style>
  346. @import url("../../saomaDiancan/static/css/common.css");
  347. page .page-block .content {
  348. background-color: #F4F5F7;
  349. padding: 0;
  350. }
  351. page .page-block .cell {
  352. background-color: #FFF;
  353. padding: 0 25rpx;
  354. }
  355. .icon_un_icon{
  356. width: 150rpx;
  357. height: 150rpx;
  358. }
  359. .rund {
  360. width: 40rpx;
  361. height: 40rpx;
  362. }
  363. .red {
  364. color: red;
  365. padding: 10rpx 25rpx;
  366. font-size: 26rpx;
  367. }
  368. page {
  369. background-color: #F4F5F7;
  370. }
  371. .sub-btn {
  372. width: 690rpx;
  373. height: 100rpx;
  374. background: linear-gradient(315deg, #3387ff 2%, #569bff 99%);
  375. border-radius: 8rpx;
  376. box-shadow: 0px 0px 8rpx 0px rgba(51, 135, 255, 0.20);
  377. text-align: center;
  378. line-height: 100rpx;
  379. color: #fff;
  380. font-size: 36rpx;
  381. font-weight: bold;
  382. position: fixed;
  383. left: 50%;
  384. bottom: 70rpx;
  385. transform: translateX(-50%);
  386. margin: 0 auto;
  387. margin-top: 30px;
  388. z-index: 999;
  389. }
  390. .checklist-box {
  391. display: -webkit-box;
  392. display: -webkit-flex;
  393. display: flex;
  394. -webkit-box-orient: horizontal;
  395. -webkit-box-direction: normal;
  396. -webkit-flex-direction: row;
  397. flex-direction: row;
  398. -webkit-box-align: center;
  399. -webkit-align-items: center;
  400. align-items: center;
  401. margin: 5px 0;
  402. margin-right: 22px;
  403. }
  404. .radio__inner {
  405. -webkit-flex-shrink: 0;
  406. flex-shrink: 0;
  407. display: -webkit-box;
  408. display: -webkit-flex;
  409. display: flex;
  410. -webkit-box-pack: center;
  411. -webkit-justify-content: center;
  412. justify-content: center;
  413. -webkit-box-align: center;
  414. -webkit-align-items: center;
  415. align-items: center;
  416. position: relative;
  417. border: 1px solid #DCDFE6;
  418. border-radius: 2px;
  419. box-sizing: border-box;
  420. width: 16px;
  421. height: 16px;
  422. border-radius: 16px;
  423. background-color: #fff;
  424. z-index: 1;
  425. -webkit-transition: border-color .3s;
  426. transition: border-color .3s;
  427. }
  428. .radio__inner-icon {
  429. width: 8px;
  430. height: 8px;
  431. border-radius: 10px;
  432. opacity: 0;
  433. -webkit-transition: -webkit-transform .3s;
  434. transition: -webkit-transform .3s;
  435. transition: transform .3s;
  436. transition: transform .3s, -webkit-transform .3s;
  437. }
  438. .is-default-checked {
  439. opacity: 1;
  440. background-color: #007aff;
  441. -webkit-transform: rotate(45deg) scaleY(1);
  442. transform: rotate(45deg) scaleY(1);
  443. }
  444. .act_border {
  445. border: 1rpx solid #007aff;
  446. }
  447. .checklist-text {
  448. font-size: 28rpx;
  449. margin-left: 5px;
  450. -webkit-transition: color 0.2s;
  451. transition: color 0.2s;
  452. color: #000;
  453. }
  454. .texteares {
  455. width: 100%;
  456. padding: 30rpx;
  457. }
  458. </style>