register_3.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <template>
  2. <view>
  3. <u-form :model="form">
  4. <u-card :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false">
  5. <view slot="head">
  6. <view class="u-flex">
  7. <view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
  8. 选择合作品牌
  9. </view>
  10. </view>
  11. <view slot="body">
  12. <u-form-item prop="cooperation">
  13. <view style="margin-right: 10rpx;">
  14. <u-icon name="order" size="36"></u-icon>
  15. </view>
  16. <u-input placeholder="点击选择合作品牌" :disabled="true" @click="brandShow = true;" v-model="form.cooperation"></u-input>
  17. <view class="" slot="right">
  18. <u-icon name="arrow-right" color="#666666" size="36"></u-icon>
  19. </view>
  20. </u-form-item>
  21. </view>
  22. </u-card>
  23. <u-popup mode="bottom" v-model="brandShow">
  24. <view class="u-flex u-row-between u-padding-left-40 u-padding-right-40" style="height: 90rpx;" @click="show = false;">
  25. <view style="padding: 16rpx;font-size:30rpx" @click="brandShow=false">
  26. 取消
  27. </view>
  28. <view style="padding: 16rpx;color:#0095FF;font-size:30rpx" @click="getCooperation">
  29. 确认
  30. </view>
  31. </view>
  32. <u-line color="#e4e7ed"></u-line>
  33. <view class="content">
  34. <scroll-view scroll-y="true" style="height: 300rpx;">
  35. <view class="u-flex u-row-center">
  36. <u-checkbox-group :wrap="true" @change="checkboxGroupChange" style="display: flex;justify-content: center">
  37. <u-checkbox v-model="item.checked" v-for="(item, index) in agentList" :key="index" :name="item.brand" shape="circle">
  38. <view class="u-flex u-row-left" style="width: 150rpx;">
  39. {{item.brand}}
  40. </view>
  41. </u-checkbox>
  42. </u-checkbox-group>
  43. </view>
  44. </scroll-view>
  45. </view>
  46. </u-popup>
  47. <u-card :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false">
  48. <view slot="head">
  49. <view class="u-flex">
  50. <view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
  51. 已选合作品牌
  52. </view>
  53. </view>
  54. <view slot="body">
  55. <view class="u-flex u-flex-wrap u-row-around">
  56. <u-image width="40%" height="100rpx" src="../../static/sailun/anyu.png" style="margin:10rpx;"></u-image>
  57. <u-image width="40%" height="100rpx" src="../../static/sailun/anyu.png" style="margin:10rpx;"></u-image>
  58. <u-image width="40%" height="100rpx" src="../../static/sailun/anyu.png" style="margin:10rpx;"></u-image>
  59. <u-image width="40%" height="100rpx" src="../../static/sailun/anyu.png" style="margin:10rpx;"></u-image>
  60. </view>
  61. </view>
  62. </u-card>
  63. <u-card :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false"
  64. v-for="(item, index) in checkedAgentlist" :key="index">
  65. <view slot="head">
  66. <view class="u-flex">
  67. <view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
  68. {{item.brand}}合作品牌签约任务
  69. </view>
  70. </view>
  71. <view slot="body">
  72. <u-form-item>
  73. <view style="margin-right: 10rpx;">
  74. <u-icon name="account" size="36"></u-icon>
  75. </view>
  76. <view class="">
  77. {{item.name}}
  78. </view>
  79. </u-form-item>
  80. <u-form-item prop="tasklist">
  81. <view style="margin-right: 10rpx;">
  82. <u-icon name="order" size="36"></u-icon>
  83. </view>
  84. <u-radio-group v-model="item.taskNum">
  85. <u-radio v-for="(i, index) in tasknameList" :key="index" :name="i.task" :disabled="i.taskdisabled">
  86. {{i.task}}
  87. </u-radio>
  88. </u-radio-group>
  89. </u-form-item>
  90. </view>
  91. </u-card>
  92. <u-form-item prop="protocol" :border-bottom="false">
  93. <view style="margin:0 30rpx;">
  94. <u-checkbox-group>
  95. <u-checkbox v-model="form.protocol">同意《用户协议》及《隐私政策》</u-checkbox>
  96. </u-checkbox-group>
  97. </view>
  98. </u-form-item>
  99. </u-form>
  100. <view style="margin:0 30rpx;">
  101. <u-button @click="nextStep" type="primary" @tap="$u.debounce(submit, 2000,immediate = true)" :loading="loading"
  102. :ripple="true" ripple-bg-color="#99d4ff">确认注册</u-button>
  103. </view>
  104. </view>
  105. </template>
  106. <script>
  107. import {
  108. request
  109. } from '../../common/request/request'
  110. require("promise.prototype.finally").shim()
  111. export default {
  112. data() {
  113. return {
  114. brandShow: false,
  115. loading: false,
  116. form: {
  117. cooperation: '',
  118. protocol: false,
  119. },
  120. formData: '',
  121. dataUrl: '',
  122. agentList: [], //经销商信息
  123. checkedAgentlist: [],
  124. taskList: [],
  125. tasknameList: [],
  126. brandAgentLvQueryList: []
  127. }
  128. },
  129. created() {
  130. },
  131. mounted() {
  132. this.getAgentArea()
  133. this.getTasknum()
  134. // uni.$on('dataUrl', (data) => {
  135. // this.dataUrl = data
  136. // })
  137. },
  138. methods: {
  139. getAgentArea() {
  140. uni.$on('formData', (data) => {
  141. this.formData = data
  142. console.log(this.formData)
  143. let that=this
  144. })
  145. request({
  146. url: '/sailun/appStoreBasicInfo/getAgentArea',
  147. method: 'post',
  148. data: {
  149. "province": "山东省",
  150. "city": "青岛市",
  151. "area": "市北区",
  152. // "area":this.formData.district,
  153. // "city":this.formData.city,
  154. // "province":this.formData.province,
  155. "spart": "10",
  156. "vkorg": "8100",
  157. "vtweg": "10"
  158. }
  159. }).then(res => {
  160. console.log(res.data.code)
  161. if (res.data.code == 0) {
  162. this.agentList = res.data.Data.data
  163. this.agentList = this.agentList.reduce((res, item, index, array) => {
  164. console.log("11111")
  165. for (let i = 0; i < array[index].brandList.length; i++) {
  166. res.push({
  167. brand: array[index].brandList[i],
  168. brandCode: array[index].brandList[i],
  169. name: item.name,
  170. kunnr: item.kunnr,
  171. agent_id: item.kunnr,
  172. taskNum: "",
  173. checked: false,
  174. disabled: false,
  175. })
  176. }
  177. return res;
  178. }, []);
  179. }
  180. if (res.data.code == 500) {
  181. this.$u.toast(res.data.msg);
  182. }
  183. return this.agentList
  184. }).catch(err => {
  185. console.log(err)
  186. }).finally(() => {
  187. })
  188. },
  189. getTasknum() {
  190. request({
  191. url: '/sailun/appStoreBasicInfo/enum',
  192. method: 'get',
  193. data: {},
  194. }).then(res => {
  195. if (res.data.code == 0) {
  196. this.taskList = res.data.data
  197. this.tasknameList = this.taskList.reduce((res, item) => {
  198. res.push({
  199. task: item.signLv,
  200. taskdisabled: false,
  201. })
  202. return res;
  203. }, []);
  204. }
  205. if (res.data.code == 500) {
  206. this.$u.toast(res.data.msg);
  207. }
  208. }).catch(err => {
  209. console.log(err)
  210. }).finally(() => {
  211. })
  212. },
  213. checkboxGroupChange(e) {
  214. this.cooperations = e
  215. },
  216. getCooperation() {
  217. if (this.cooperations != null) {
  218. this.form.cooperation = this.cooperations.toString();
  219. this.checkedAgentlist = this.agentList.filter(item => this.cooperations.indexOf(item.brand) > -1)
  220. this.brandShow = false
  221. } else {
  222. console.log("至少选择一项")
  223. }
  224. },
  225. getTaskconfirm(e) {
  226. this.form.tasklist = e[0].label;
  227. },
  228. submit() {
  229. this.brandAgentLvQueryList = this.checkedAgentlist.reduce((res, item) => {
  230. res.push({
  231. agent_id: item.agent_id,
  232. brand: item.brand,
  233. brandCode: item.brandCode,
  234. kunnr: item.kunnr,
  235. lvCount: parseInt(item.taskNum.substring(2)).toString(),
  236. showLv: item.taskNum,
  237. spart: "10",
  238. vkorg: "8100",
  239. vtweg: "10"
  240. })
  241. return res;
  242. }, []);
  243. // let data = {
  244. // "brandAgentLvQueryList":this.brandAgentLvQueryList,
  245. // "city": "string",
  246. // "contactName": "string",
  247. // "district": "string",
  248. // "jd": "string",
  249. // "licenseUrl": "string",
  250. // "mobileCode": "string",
  251. // "province": "string",
  252. // "storeImageUrl": "string",
  253. // "storeName": "string",
  254. // "storePhone": "string",
  255. // "version": 0,
  256. // "wd": "string"
  257. // }
  258. // console.log(data)
  259. // request({
  260. // url: '/sailun/appStoreBasicInfo/storeReg',
  261. // method: 'post',
  262. // data: data
  263. // }).then(res => {
  264. // console.log(res)
  265. // if (res.data.code == 0) {
  266. // this.loading = true
  267. // setTimeout(() => {
  268. // this.$u.route({
  269. // url: 'pages/login/index',
  270. // type: "reLaunch"
  271. // })
  272. // this.loading = false
  273. // }, 2000)
  274. // }
  275. // if (res.data.code == 500) {
  276. // this.$u.toast(res.data.msg);
  277. // }
  278. // }).catch(err => {
  279. // console.log(err)
  280. // }).finally(() => {
  281. // })
  282. },
  283. }
  284. }
  285. </script>
  286. <style lang="scss" scoped>
  287. .content {
  288. padding: 24rpx;
  289. text-align: center;
  290. .u-checkbox[data-v-54acf820] {
  291. display: flex;
  292. justify-content: center;
  293. }
  294. }
  295. </style>