sm.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <template>
  2. <view class="content">
  3. <u-toast ref="uToast" />
  4. <u-popup v-model="show" class="popup" @close="close" mode="bottom" border-radius="30" :closeable="true">
  5. <view class="top">
  6. <view class="top-center-1">收到</view>
  7. </view>
  8. <view class="top-content-2">
  9. <view>来自</view>
  10. <view class="top-content-green">{{title}}</view>
  11. <view>的邀请。</view>
  12. </view>
  13. <view class="top-content-3">
  14. 接受邀请后对方将可以查看您的个人粮商信息(姓名、手机号、账户信息和身份证附件等)。
  15. </view>
  16. <div class="content-bottom">
  17. <view v-if="grainMerchantList.length>0" class="title">请选择粮商身份</view>
  18. <view v-if="grainMerchantList.length>0">
  19. <view v-for="(item,index) in grainMerchantList" :key="index">
  20. <view v-if="item.cover!=1" :class="item.check?'item-select':'item'" @click="selectItem(item)">
  21. <img v-if="item.check" class="img" src="../../../static/img/select.png" alt="">
  22. <view class="name">{{item.customerName}}</view>
  23. <view class="phone">
  24. <view class="number">{{item.customerPhone}}</view>
  25. <view>({{item.authenticationStatus}})</view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="nolist" v-if="grainMerchantList.length==0">
  31. <img class="img" src="../../../static/img/nolist.png" alt="">
  32. <view class="text">您还未认证个人粮商身份</view>
  33. </view>
  34. <button v-if="grainMerchantList.length>0" class="custom-style" @click="submit">接受邀请</button>
  35. <button v-if="grainMerchantList.length==0" class="custom-style" @click="attestation">接受并去认证</button>
  36. </div>
  37. </u-popup>
  38. </view>
  39. </template>
  40. <script>
  41. import {
  42. mapState
  43. } from 'vuex';
  44. export default {
  45. data() {
  46. return {
  47. show: true,
  48. identityAuthenticationInfo: {},
  49. title: "黑龙江中天昊元贸易有限公司",
  50. grainMerchantList: []
  51. // grainMerchantList: [{
  52. // name: "张三",
  53. // phone: "189****9999",
  54. // state: "已认证",
  55. // check: false
  56. // },
  57. // {
  58. // name: "李四",
  59. // phone: "189****9999",
  60. // state: "审核中",
  61. // check: false
  62. // }
  63. // ]
  64. }
  65. },
  66. computed: {
  67. ...mapState(['hasLogin', 'userInfo'])
  68. },
  69. methods: {
  70. selectItem(item) {
  71. console.log("item", item)
  72. item.check = !item.check
  73. },
  74. //查询粮商身份
  75. selectGrainMerchantList() {
  76. //
  77. },
  78. onLoad(e) {
  79. this.title = e.name
  80. },
  81. onShow() {
  82. this.getList()
  83. },
  84. getList() {
  85. console.log(this.userInfo)
  86. this.identityAuthenticationInfo.commonId = this.userInfo.id
  87. this.$api.doRequest('get', '/identityAuthenticationInfo/selectIdentityAuthenticationInfo', {
  88. pageSize: 100,
  89. currentPage: 1,
  90. commonId: this.userInfo.id,
  91. flag: 0
  92. }, 'application/json;charset=UTF-8').then(res => {
  93. for (var i = 0; i < res.data.data.records.length; i++) {
  94. res.data.data.records[i].basis = "false"
  95. if (res.data.data.records[i].defaultFlag == 1) {
  96. res.data.data.records[i].basis = "true"
  97. }
  98. }
  99. var data = res.data.data.records
  100. for (var i = 0; i < data.length; i++) {
  101. if (data[i].customerTypeFlag == 2) {
  102. if (data[i].compName && data[i].compName.length > 10) {
  103. data[i].compName = data[i].compName.substring(0, 10) + "..."
  104. }
  105. }
  106. }
  107. this.grainMerchantList = res.data.data.records
  108. console.log(this.grainMerchantList)
  109. })
  110. .catch(res => {
  111. if (res.message) {
  112. uni.showToast({
  113. title: res.message,
  114. icon: 'none',
  115. duration: 2000
  116. })
  117. } else {
  118. uni.showToast({
  119. title: "系统异常,请联系管理员",
  120. icon: 'none',
  121. duration: 2000
  122. })
  123. }
  124. });
  125. },
  126. submit() {
  127. let _isAllCheck = false
  128. for (let i = 0; i < this.grainMerchantList.length; i++) {
  129. if (this.grainMerchantList[i].check) {
  130. _isAllCheck = true
  131. }
  132. }
  133. if (!_isAllCheck) {
  134. this.$refs.uToast.show({
  135. title: '至少选择一个身份',
  136. type: "error",
  137. icon: false
  138. })
  139. }
  140. },
  141. //接受并认证
  142. attestation() {},
  143. close() {
  144. uni.navigateBack(-1)
  145. }
  146. }
  147. }
  148. </script>
  149. <style scoped lang="scss">
  150. .content {
  151. background: white;
  152. }
  153. .top {
  154. background: url(../../../static/img/bg@2x.png);
  155. background-size: 100% 100%;
  156. padding: 0 80rpx 0 80rpx;
  157. text-align: center;
  158. height: 310rpx;
  159. }
  160. .content-bottom {
  161. padding: 50rpx 50rpx 0 50rpx;
  162. .title {
  163. font-size: 32rpx;
  164. font-weight: 600;
  165. color: #333333;
  166. text-align: center;
  167. margin-bottom: 30rpx;
  168. }
  169. .active {}
  170. .item-select {
  171. border-radius: 1px;
  172. border: 1px solid #C5CAD5;
  173. padding: 15rpx 40rpx;
  174. background: #F4FAF4;
  175. border: 1px solid #22C572;
  176. margin-bottom: 20rpx;
  177. position: relative;
  178. .img {
  179. position: absolute;
  180. width: 42rpx;
  181. height: 40rpx;
  182. top: 0;
  183. right: 0;
  184. }
  185. .name {
  186. font-size: 32rpx;
  187. font-weight: 600;
  188. color: #22C572;
  189. }
  190. .phone {
  191. display: flex;
  192. align-items: center;
  193. color: #8E93A3;
  194. .number {
  195. margin-right: 20rpx;
  196. }
  197. }
  198. }
  199. .item {
  200. border-radius: 1px;
  201. border: 1px solid #C5CAD5;
  202. padding: 15rpx 40rpx;
  203. margin-bottom: 20rpx;
  204. position: relative;
  205. .img {
  206. position: absolute;
  207. width: 42rpx;
  208. height: 40rpx;
  209. top: 0;
  210. right: 0;
  211. }
  212. .name {
  213. font-size: 32rpx;
  214. font-weight: 600;
  215. }
  216. .phone {
  217. display: flex;
  218. align-items: center;
  219. color: #8E93A3;
  220. .number {
  221. margin-right: 20rpx;
  222. }
  223. }
  224. }
  225. }
  226. .top-center-1 {
  227. font-size: 42rpx;
  228. font-weight: 600;
  229. color: #333333;
  230. position: relative;
  231. top: 88rpx;
  232. }
  233. .top-content-2 {
  234. display: flex;
  235. justify-content: center;
  236. align-items: flex-end;
  237. position: relative;
  238. top: -50px;
  239. }
  240. .top-content-3 {
  241. position: relative;
  242. top: -25px;
  243. padding: 0 81rpx;
  244. }
  245. .top-content-green {
  246. color: #22C572;
  247. font-size: 32rpx;
  248. }
  249. .custom-style {
  250. background: #22C572;
  251. border-radius: 46px;
  252. margin: 50rpx;
  253. color: white;
  254. }
  255. .nolist {
  256. text-align: center;
  257. margin: 50rpx 50rpx 100rpx 50rpx;
  258. .img {
  259. width: 240rpx;
  260. height: 240rpx;
  261. }
  262. .text {
  263. margin: 20rpx;
  264. color: #8E93A3;
  265. }
  266. }
  267. </style>