ApplyTerm.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. <template>
  2. <view class="apply-term">
  3. <image :src="distributionSet.image || default_img" mode="aspectFill" class="apply-img"></image>
  4. <!-- 无条件成为分销商 -->
  5. <view class="apply-cont" v-if="distributionSet.businessmanCondition === 0">
  6. <view class="apply-tip">
  7. <view class="audit-img"><image src="https://onlineimg.qianniao.vip/no_coll.jpg" mode="aspectFit"></image></view>
  8. <view class="tip-text">您还不是{{ text_set.name || '分销商' }},点击下方按钮立即{{ text_set.distributor || '成为分销商' }}</view>
  9. </view>
  10. <view @click="subApply" class="sub-btn">立即{{ text_set.distributor || '成为分销商' }}</view>
  11. </view>
  12. <!-- 申请成为分销商条件为填写资料申请 -->
  13. <view class="apply-cont" v-if="distributionSet.businessmanCondition === 1">
  14. <u-form label-width="140rpx">
  15. <block v-for="(item, index) in distributionSet.info" :key="index">
  16. <u-form-item :label="item.prop"><u-input :clearable="false" v-model="item.value" /></u-form-item>
  17. </block>
  18. </u-form>
  19. <view class="apply-agree" v-if='distributionSet.title'>
  20. 提交代表您同意
  21. <text @click="goPage('/pagesT/Distribution/Agreement')" class="apply-agree-text primary-color">《{{ distributionSet.title }}》</text>
  22. </view>
  23. <view @click="subApply" class="sub-btn">申请{{ text_set.distributor || '成为分销商' }}</view>
  24. </view>
  25. <!-- 申请成为分销商条件为累计消费次数或者累计消费金额 -->
  26. <view class="apply-cont" v-if="[2, 3].includes(distributionSet.businessmanCondition)">
  27. <view class="apply-num-cont">
  28. <view>您已累计消费</view>
  29. <view class="num-weight" v-if="distributionSet.businessmanCondition === 2">
  30. <text class="_number">0</text>
  31. <text>次</text>
  32. </view>
  33. <view class="num-weight" v-if="distributionSet.businessmanCondition === 3">
  34. <text class="_number">0</text>
  35. <text>元</text>
  36. </view>
  37. </view>
  38. <view class="apply-tip-view">
  39. 您还不是{{ text_set.name || '分销商' }},点击下方按钮申请{{ text_set.distributor || '成为分销商' }}
  40. </view>
  41. <view class="sub-btn" @click="subApply">申请成为分销商</view>
  42. <view class="user-discription">
  43. <view class="user-d-tit">
  44. 用户须知
  45. </view>
  46. <view class="user-d-info">
  47. 1、当您点击申请成为分销商按钮后,开始累计您在本店的{{distributionSet.businessmanCondition === 3?'消费金额':'消费次数'}}</text>;
  48. </view>
  49. <view class="user-d-info">
  50. 2、您在本店累计{{distributionSet.businessmanCondition === 3?'消费金额':'消费次数'}}</text>满<text class="_importent">{{distributionSet.businessmanCondition === 3?distributionSet.buyAmount+'元':distributionSet.buyNum+'次'}}</text>,<text v-if="distributionSet.audit===4">通过审核后</text>即可{{ text_set.distributor || '成为分销商' }}
  51. </view>
  52. </view>
  53. </view>
  54. <!-- 申请成为分销商条件为购买商品 -->
  55. <view class="apply-cont" v-if="distributionSet.businessmanCondition === 4">
  56. <view class="apply-tip-view">
  57. 您还不是{{ text_set.name || '分销商' }},点击下方按钮申请{{ text_set.distributor || '成为分销商' }}
  58. </view>
  59. <view class="sub-btn" @click="subApply">申请成为分销商</view>
  60. <view class="user-discription">
  61. <view class="user-d-tit">
  62. 用户须知
  63. </view>
  64. <view class="user-d-info">
  65. 当您点击申请成为分销商按钮后,购买指定商品,<text v-if="distributionSet.audit===4">通过审核后</text>即可{{ text_set.distributor || '成为分销商' }}
  66. </view>
  67. </view>
  68. </view>
  69. <AddCardModel :selAddress="now_sel_address" :skuId="goods_sku_id" @close="is_add_show = false" @change="cardModelPopChange" :isShow="is_add_show" :goodsId="goods_id" />
  70. </view>
  71. </template>
  72. <script>
  73. import AddCardModel from '@/components/AddCardModel';
  74. export default {
  75. components: {
  76. AddCardModel,
  77. },
  78. data() {
  79. return {
  80. default_img: 'https://onlineimg.qianniao.vip/931544405107da76ca2ec31cd63fae49/1596008994491apply_banner.png',
  81. is_add_show: false,
  82. isLoding: false,
  83. goods_id: 0,
  84. now_sel_address: {},
  85. goodsList: [],
  86. apply_form: {
  87. email: '',
  88. name: '',
  89. phone: ''
  90. },
  91. customerId: 0,
  92. userName: '',
  93. distributionSet: {
  94. image: '',
  95. info: [],
  96. businessmanCondition: 0
  97. },
  98. auditStatus: 0, // 审核状态
  99. applicationCondition: 0, // 申请成为分销商条件
  100. goods_sku_id: 0,
  101. text_set: {}
  102. };
  103. },
  104. onLoad(options) {
  105. if (options.auditStatus && options.applicationCondition) {
  106. this.auditStatus = parseInt(options.auditStatus);
  107. this.applicationCondition = parseInt(options.applicationCondition);
  108. } else {
  109. this.customerId = this.$store.state.userStatus.id;
  110. this.userName = this.$store.state.userStatus.name;
  111. this.distributionSet = this.$store.state.distributionSet;
  112. // 申请成为分销商条件为购买商品
  113. if (this.distributionSet.businessmanCondition === 4) {
  114. this.getBuyGoods();
  115. }
  116. }
  117. this.text_set = this.$store.state.distributionTextSet;
  118. },
  119. methods: {
  120. // 查询升级商品
  121. async getBuyGoods() {
  122. this.$u.api.getBuyGoods().then(({data})=>{
  123. this.goodsList = data;
  124. })
  125. },
  126. cardModelPopChange(obj) {
  127. if (!obj.show) {
  128. this.is_add_show = false;
  129. }
  130. },
  131. addCard(id, skuId) {
  132. this.goods_id = id;
  133. this.goods_sku_id = skuId;
  134. this.is_add_show = true;
  135. },
  136. async subApply() {
  137. let params = {
  138. customerId: this.customerId
  139. };
  140. if (this.distributionSet.businessmanCondition === 1) {
  141. let isSub = true;
  142. for (let i in this.distributionSet.info) {
  143. if (!this.distributionSet.info[i].value) {
  144. isSub = false;
  145. break;
  146. }
  147. }
  148. if (!isSub) {
  149. this.$api.msg('请输入申请资料');
  150. return;
  151. }
  152. params.info = this.distributionSet.info;
  153. }
  154. this.$u.api.applicationBusinessman(params).then(res=>{
  155. if (this.distributionSet.businessmanCondition === 0) {
  156. // 无条件 点击按钮自动成为分销商
  157. this.$api.msg('恭喜您已成为分销商');
  158. setTimeout(() => {
  159. this.goPage('/pagesT/Distribution/Distribution');
  160. }, 500);
  161. } else if(this.distributionSet.businessmanCondition === 4){
  162. this.$api.msg('申请成功');
  163. setTimeout(() => {
  164. this.goPage('/pagesT/Distribution/ApplyAudit?auditStatus=1&applicationCondition=4','redirectTo');
  165. }, 500);
  166. }else {
  167. // 不需要审核,填写完了条件成为分销商
  168. if (this.distributionSet.audit === 4&&this.distributionSet.businessmanCondition === 1) {
  169. this.$api.msg('恭喜您已成为分销商');
  170. setTimeout(() => {
  171. this.goPage('/pagesT/Distribution/Distribution');
  172. }, 500);
  173. } else {
  174. // 不需要审核,填写完了等待审核
  175. this.$api.msg('申请成功,正在审核中');
  176. setTimeout(() => {
  177. uni.navigateBack();
  178. }, 500);
  179. }
  180. }
  181. })
  182. }
  183. }
  184. };
  185. </script>
  186. <style lang="scss">
  187. .apply-img {
  188. width: 100%;
  189. height: 322upx;
  190. display: block;
  191. }
  192. .apply-cont {
  193. padding: 20upx 30upx;
  194. .apply-agree {
  195. font-size: 24upx;
  196. color: #999;
  197. padding: 20upx 0;
  198. }
  199. .apply-tip-view {
  200. text-align: center;
  201. ._importent {
  202. color: #ff5a5f;
  203. }
  204. }
  205. .apply-tip {
  206. border-radius: 8upx;
  207. width: 650upx;
  208. margin: 26upx auto 46upx;
  209. box-shadow: 0 0 20upx 4upx #f5f5f5;
  210. padding: 50upx 0;
  211. .audit-img {
  212. image {
  213. display: block;
  214. width: 200upx;
  215. height: 200upx;
  216. margin: 0 auto;
  217. }
  218. }
  219. .tip-text {
  220. padding: 0 24upx;
  221. text-align: center;
  222. opacity: 0.9;
  223. line-height: 60upx;
  224. }
  225. }
  226. .sub-btn {
  227. font-size: 30upx;
  228. text-align: center;
  229. color: #ffffff;
  230. width: 645upx;
  231. height: 72upx;
  232. background-color: #fe582e;
  233. border-radius: 40px;
  234. line-height: 72upx;
  235. margin: 50upx auto 0;
  236. }
  237. .user-discription{
  238. font-size: 24upx;
  239. line-height: 40rpx;
  240. padding-top: 30rpx;
  241. .user-d-tit{
  242. color: #333;
  243. font-weight: bold;
  244. }
  245. .user-d-info{
  246. color: #666;
  247. ._importent{
  248. color: #fe582e;
  249. font-weight: bold;
  250. }
  251. }
  252. }
  253. }
  254. .apply-num-cont {
  255. width: 650upx;
  256. margin: 46upx auto;
  257. font-size: 24upx;
  258. color: #898c98;
  259. text-align: center;
  260. box-shadow: 0 0 20upx 4upx #f5f5f5;
  261. padding: 64upx 0;
  262. .num-weight {
  263. padding-top: 40upx;
  264. font-weight: bold;
  265. color: #3d404c;
  266. ._number {
  267. margin-right: 10upx;
  268. font-size: 66upx;
  269. }
  270. }
  271. }
  272. .goods-item-box {
  273. border-bottom: 1upx solid #eee;
  274. padding: 18upx 0;
  275. position: relative;
  276. .sale-end-icon {
  277. font-size: 90upx;
  278. color: $uni-color-error;
  279. display: block;
  280. position: absolute;
  281. right: 60upx;
  282. top: 80upx;
  283. }
  284. .right {
  285. width: calc(100% - 188upx);
  286. }
  287. .title {
  288. font-size: 28upx;
  289. color: #303133;
  290. width: 100%;
  291. height: 76upx;
  292. line-height: 36upx;
  293. text-overflow: -o-ellipsis-lastline;
  294. overflow: hidden;
  295. text-overflow: ellipsis;
  296. display: -webkit-box;
  297. -webkit-line-clamp: 2;
  298. line-clamp: 2;
  299. -webkit-box-orient: vertical;
  300. }
  301. .subTitle {
  302. font-size: 24upx;
  303. color: #666;
  304. white-space: nowrap;
  305. width: 100%;
  306. overflow: hidden;
  307. /* 默认溢出隐藏 */
  308. text-overflow: ellipsis;
  309. padding: 6upx 0;
  310. height: 48upx;
  311. line-height: 42upx;
  312. .gradeName {
  313. padding: 0 10upx;
  314. line-height: 32upx;
  315. color: #fe582e;
  316. border: 1upx solid #fe582e;
  317. border-radius: 20upx;
  318. display: inline-block;
  319. vertical-align: middle;
  320. height: 32upx;
  321. margin-right: 10upx;
  322. }
  323. }
  324. .price {
  325. display: inline-block;
  326. font-size: 28upx;
  327. color: #fe582e;
  328. font-weight: 500;
  329. }
  330. .price .icon-rmb {
  331. font-size: 22upx;
  332. }
  333. .imgStyle {
  334. padding-right: 24upx;
  335. }
  336. .imgStyle image {
  337. width: 160upx;
  338. height: 160upx;
  339. border: 1px solid #eee;
  340. border-radius: 4upx;
  341. display: block;
  342. }
  343. /* 选规格 */
  344. .add-cart-btn {
  345. position: absolute;
  346. right: 0;
  347. bottom: 45%;
  348. transform: translateY(50%);
  349. background-color: #fe582e;
  350. color: #fff;
  351. display: block;
  352. width: 50upx;
  353. height: 50upx;
  354. border-radius: 100%;
  355. font-size: 24upx;
  356. text-align: center;
  357. line-height: 50upx;
  358. }
  359. }
  360. </style>