register_3.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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. uni.$on('formData', (data) => {
  131. this.formData =data.formData
  132. this.dataUrl=data.dataUrl
  133. })
  134. },
  135. mounted() {
  136. this.getAgentArea()
  137. this.getTasknum()
  138. },
  139. methods: {
  140. getAgentArea() {
  141. request({
  142. url: '/sailun/appStoreBasicInfo/getAgentArea',
  143. method: 'post',
  144. data: {
  145. "area": this.formData.district,
  146. "city": this.formData.city,
  147. "province": this.formData.province,
  148. "spart": "10",
  149. "vkorg": "8100",
  150. "vtweg": "10"
  151. }
  152. }).then(res => {
  153. if (res.data.code == 0) {
  154. this.agentList = res.data.Data.data
  155. this.agentList = this.agentList.reduce((res, item, index, array) => {
  156. for (let i = 0; i < array[index].brandList.length; i++) {
  157. res.push({
  158. brand: array[index].brandList[i],
  159. brandCode: array[index].brandList[i],
  160. name: item.name,
  161. kunnr: item.kunnr,
  162. agent_id: item.kunnr,
  163. taskNum: "",
  164. checked: false,
  165. disabled: false,
  166. })
  167. }
  168. return res;
  169. }, []);
  170. }
  171. if (res.data.code == 500) {
  172. this.$u.toast(res.data.msg);
  173. }
  174. return this.agentList
  175. }).catch(err => {
  176. console.log(err)
  177. }).finally(() => {
  178. })
  179. },
  180. getTasknum() {
  181. request({
  182. url: '/sailun/appStoreBasicInfo/enum',
  183. method: 'get',
  184. data: {},
  185. }).then(res => {
  186. if (res.data.code == 0) {
  187. this.taskList = res.data.data
  188. this.tasknameList = this.taskList.reduce((res, item) => {
  189. res.push({
  190. task: item.signLv,
  191. taskdisabled: false,
  192. })
  193. return res;
  194. }, []);
  195. }
  196. if (res.data.code == 500) {
  197. this.$u.toast(res.data.msg);
  198. }
  199. }).catch(err => {
  200. console.log(err)
  201. }).finally(() => {
  202. })
  203. },
  204. checkboxGroupChange(e) {
  205. this.cooperations = e
  206. },
  207. getCooperation() {
  208. if (this.cooperations != null) {
  209. this.form.cooperation = this.cooperations.toString();
  210. this.checkedAgentlist = this.agentList.filter(item => this.cooperations.indexOf(item.brand) > -1)
  211. this.brandShow = false
  212. } else {
  213. console.log("至少选择一项")
  214. }
  215. },
  216. getTaskconfirm(e) {
  217. this.form.tasklist = e[0].label;
  218. },
  219. submit() {
  220. this.brandAgentLvQueryList = this.checkedAgentlist.reduce((res, item) => {
  221. res.push({
  222. agent_id: item.agent_id,
  223. agent_name:item.name,
  224. brand: item.brand,
  225. brandCode: item.brandCode,
  226. kunnr: item.kunnr,
  227. lvCount: parseInt(item.taskNum.substring(2)).toString(),
  228. showLv: item.taskNum,
  229. spart: "10",
  230. vkorg: "8100",
  231. vtweg: "10"
  232. })
  233. return res;
  234. }, []);
  235. let data = {
  236. "brandAgentLvQueryList":this.brandAgentLvQueryList,
  237. "city":this.formData.city,
  238. "contactName":this.formData.name,
  239. "district":this.formData.district,
  240. "jd":this.formData.longitude,
  241. "licenseUrl":this.dataUrl.licenseUrl,
  242. "mobileCode":this.formData.code,
  243. "province":this.formData.province,
  244. "storeImageUrl":this.dataUrl.storeUrl,
  245. "storeName":this.formData.store,
  246. "storePhone":this.formData.phone,
  247. "version":1.00,
  248. "wd":this.formData.latitude,
  249. }
  250. console.log(data)
  251. request({
  252. url: '/sailun/appStoreBasicInfo/storeReg',
  253. method: 'post',
  254. data: data
  255. }).then(res => {
  256. console.log(res)
  257. if (res.data.code == 0) {
  258. this.loading = true
  259. this.$u.toast(res.data.msg);
  260. setTimeout(() => {
  261. this.$u.route({
  262. url: 'pages/login/index',
  263. })
  264. }, 2000)
  265. }
  266. if (res.data.code == 500) {
  267. this.$u.toast(res.data.msg);
  268. }
  269. }).catch(err => {
  270. console.log(err)
  271. }).finally(() => {
  272. this.loading = false
  273. })
  274. },
  275. }
  276. }
  277. </script>
  278. <style lang="scss" scoped>
  279. .content {
  280. padding: 24rpx;
  281. text-align: center;
  282. .u-checkbox[data-v-54acf820] {
  283. display: flex;
  284. justify-content: center;
  285. }
  286. }
  287. </style>