gerenxiufu.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. <template>
  2. <view class="main" v-if="isshow!='0'">
  3. <view class="flex align-center margin-bottom-sm callback" style="color: #fff;" @click="callback">
  4. <image style="width: 50rpx;height: 50rpx;margin-right: 10rpx;" src="../../static/index/callback_white.png" mode=""></image>返回首页
  5. </view>
  6. <image class="topbg" :src="imgHost+'/static/index/top.png'"></image>
  7. <!-- <view class="top"><image src="../../static/index/r1-2x.png" mode=""></image></view> -->
  8. <view class="" style="position: relative;z-index: 1;margin-top: 96px;">
  9. <view class="flex flex-direction justify-center align-center">
  10. <image src="/static/index/47e8bab2b5b68f3fff001bce06e0a11.jpg" style="width: 200rpx;height: 200rpx;" mode=""></image>
  11. <view class="text-bold text-black margin-top-xs">
  12. 个人信用征信评估
  13. </view>
  14. </view>
  15. <view class="title">
  16. 请上传您的个人征信信用报告:
  17. </view>
  18. <view class="title-item">
  19. 温馨提示:请按照信用报告的顺序上传
  20. </view>
  21. <view class="upload">
  22. <!-- <view class="upl" @click="ChooseImage">+</view> -->
  23. <view class="cu-bar bg-white border-bottom">
  24. <view class="action">上传图片</view>
  25. <view class="action">{{ imgList.length }}/100</view>
  26. </view>
  27. <view class="cu-form-group">
  28. <view class="grid col-4 grid-square flex-sub">
  29. <view class="bg-img" v-for="(item, index) in imgList" :key="index" @tap="ViewImage" :data-url="imgList[index]">
  30. <image :src="imgList[index]" mode="aspectFill"></image>
  31. <view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index"><text class="cuIcon-close"></text></view>
  32. </view>
  33. <view class="solids" @tap="ChooseImage" v-if="imgList.length < 100"><text class="cuIcon-cameraadd"></text></view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="sub" @click="submit">提交</view>
  38. <!-- 提示框 -->
  39. <view class="cu-modal" :class="modalName == 'Modal' ? 'show' : ''">
  40. <view class="cu-dialog top">
  41. <view class="cu-bar bg-white justify-end">
  42. <view class="content">提示</view>
  43. <view class="action" @tap="hideModal">
  44. <text class="cuIcon-close yellow" />
  45. </view>
  46. </view>
  47. <view class="padding-xl">
  48. 您已提交成功,后台审核评估后会在一个工作日左右与您联系,请耐心等待。
  49. </view>
  50. </view>
  51. </view>
  52. <!-- 未登录 -->
  53. <view class="cu-modal" :class="modalName == 'WxModal' ? 'show' : ''">
  54. <view class="cu-dialog">
  55. <view class="cu-bar bg-white justify-end">
  56. <view class="content">您还未登录</view>
  57. <view class="action" @tap="modalName = ''">
  58. <text class="cuIcon-close yellow" />
  59. </view>
  60. </view>
  61. <view class="padding-xl">
  62. <view class="top-title" style="">
  63. <!-- <text class="top-title1">您还未登录</text></br> -->
  64. <text class="top-title1">请先登录再进行操作</text>
  65. </view>
  66. <view class="flex justify-around">
  67. <button type="primary" @tap="modalName = ''" class="cu-btn round greyBg lg">暂不登录</button>
  68. <button type="primary" @click="gotologin" class="cu-btn round yellowBg lg" hover-class="btn-hover">立刻登录</button>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </template>
  76. <script>
  77. import {
  78. mapState,
  79. mapMutations,
  80. mapGetters,
  81. mapActions
  82. } from 'vuex';
  83. export default {
  84. computed: {
  85. ...mapGetters({
  86. hasLogin: 'verifyJwt'
  87. }),
  88. ...mapState(['user'])
  89. },
  90. data() {
  91. return {
  92. percent: 0,
  93. imgList: [],
  94. modalName: '',
  95. isshow: "",
  96. imgHost: '',
  97. };
  98. },
  99. onLoad() {
  100. //#ifdef H5
  101. if (window.location.href.split("?")[1] != undefined) {
  102. let id = window.location.href.split("?")[1].split("=")[1]
  103. uni.setStorageSync('up_id', id)
  104. }
  105. //#endif
  106. },
  107. onShow() {
  108. let obj = uni.getStorageSync("configDatas")
  109. this.isshow = obj.is_show
  110. this.imgHost = this.$imgHost
  111. this.sharefun(this.user.id)
  112. // console.log(window.location.href)
  113. },
  114. methods: {
  115. ...mapActions({
  116. getUser: 'getUser' // 将 `this.getUser()` 映射为 `this.$store.dispatch('getUser')`
  117. }),
  118. ...mapMutations({
  119. setJwt: 'setJwt',
  120. login: 'login'
  121. }),
  122. callback(){
  123. uni.switchTab({
  124. url:"/pages/index/index"
  125. })
  126. },
  127. sharefun(id) {
  128. if (!this.hasLogin) {
  129. return false;
  130. }
  131. if (this.$wechat.is_weixin()) {
  132. this.$wechat.share({
  133. title: '聚联诚集团信用评估系统V3.0评估入口',
  134. desc: '点击链接,开始您的个人信用评估',
  135. imgUrl: "https://zhengda.oss-cn-chengdu.aliyuncs.com/juyin/static/index/20201222144549.png",
  136. }, window.location.href, id, true)
  137. }
  138. },
  139. async submit() {
  140. if (!this.hasLogin) {
  141. this.modalName = 'WxModal';
  142. return false;
  143. }
  144. if (this.imgList.length > 0) {
  145. let imgs = [];
  146. for (let img of this.imgList) {
  147. var data = await this.$request.upload('/api/common/uploadImg', img, {});
  148. if (data.code != 200) {
  149. uni.showModal({
  150. title: '错误信息',
  151. content: data.message,
  152. showCancel: false
  153. });
  154. return;
  155. }
  156. imgs.push(data.data.file_url);
  157. //既然你说数组可控,就让你看看到底可不可控
  158. //imgs.push(JSON.stringify(imgs));
  159. }
  160. let param = {
  161. type: 1,
  162. 'credit_image_urls': JSON.stringify(imgs)
  163. };
  164. uni.navigateTo({
  165. url: "agreement?data=" + JSON.stringify(param)
  166. })
  167. // let res = await this.$request.post('/api/order/sumbitOrder', param, true);
  168. // if (res.code != 200) {
  169. // uni.showModal({
  170. // title: '错误信息',
  171. // content: res.message,
  172. // showCancel: false
  173. // });
  174. // return;
  175. // }
  176. // this.modalName = 'Modal'
  177. // setTimeout(function() {
  178. // this.modalName = ''
  179. // uni.navigateBack();
  180. // }, 3500);
  181. } else {
  182. uni.showToast({
  183. title: '图片必须选择',
  184. icon: "none"
  185. });
  186. }
  187. },
  188. gotologin() {
  189. this.modalName = '';
  190. uni.navigateTo({
  191. url: "../login/login",
  192. fail: (err) => {
  193. console.log(err)
  194. }
  195. })
  196. },
  197. ChooseImage() {
  198. uni.chooseImage({
  199. count: 100, //默认9
  200. sizeType: ['original'], //可以指定是原图还是压缩图,默认二者都有
  201. sourceType: ['album'], //从相册选择
  202. success: res => {
  203. if (this.imgList.length != 0) {
  204. this.imgList = this.imgList.concat(res.tempFilePaths);
  205. } else {
  206. this.imgList = res.tempFilePaths;
  207. }
  208. }
  209. });
  210. },
  211. ViewImage(e) {
  212. uni.previewImage({
  213. urls: this.imgList,
  214. current: e.currentTarget.dataset.url
  215. });
  216. },
  217. DelImg(e) {
  218. this.imgList.splice(e.currentTarget.dataset.index, 1);
  219. },
  220. hideModal: function() {
  221. uni.switchTab({
  222. url: '/pages/index/index'
  223. })
  224. }
  225. }
  226. };
  227. </script>
  228. <style>
  229. page {
  230. margin: 0;
  231. padding: 0;
  232. background: #f5f5f5;
  233. }
  234. .callback{
  235. position: absolute;
  236. z-index: 11111;
  237. top: 30rpx;
  238. left: 15rpx;
  239. }
  240. .main {
  241. width: 100vw;
  242. height: auto;
  243. position: relative;
  244. overflow: hidden;
  245. /* margin-bottom: 55px; */
  246. }
  247. .main .topbg {
  248. width: 100%;
  249. position: absolute;
  250. top: 0;
  251. left: 0;
  252. height: 36vw;
  253. /* z-index: -1; */
  254. }
  255. .yellowBg {
  256. background: #f5cc57 !important;
  257. }
  258. .greyBg {
  259. background: grey !important;
  260. }
  261. /* .top {
  262. width: 100vw;
  263. height: 42vw;
  264. }
  265. .top image {
  266. width: 100%;
  267. height: 100%;
  268. padding: 10px;
  269. background-repeat: no-repeat;
  270. background: cover;
  271. } */
  272. .upload {
  273. width: 90vw;
  274. height: auto;
  275. background: #fff;
  276. /* padding: 15px; */
  277. margin: 0 5vw;
  278. }
  279. /* .upload .title {
  280. width: 100%;
  281. height: 40px;
  282. line-height: 40px;
  283. } */
  284. .title {
  285. width: 90vw;
  286. /* height: 45px; */
  287. /* line-height: 45px; */
  288. font-size: 32rpx;
  289. font-weight: 400;
  290. margin: 5vw 5vw 2vw 5vw;
  291. }
  292. .title-item {
  293. color: #f5cc57;
  294. margin: 0 5vw;
  295. margin-bottom: 20rpx;
  296. }
  297. .upload .upl {
  298. width: 100px;
  299. height: 100px;
  300. border: 1px solid #8799a3;
  301. color: #8799a3;
  302. line-height: 100px;
  303. text-align: center;
  304. font-size: 30px;
  305. border-radius: 5px;
  306. margin: 10px calc(50% - 57px);
  307. }
  308. /* .upload .sub {
  309. width: 80px;
  310. height: 30px;
  311. line-height: 30px;
  312. text-align: center;
  313. color: #fff;
  314. background: #f1c554;
  315. border-radius: 30px;
  316. margin: 50px calc(50% - 47px) 10px calc(50% - 47px);
  317. } */
  318. .sub {
  319. width: 90vw;
  320. height: 80rpx;
  321. line-height: 80rpx;
  322. margin: 5vw;
  323. text-align: center;
  324. color: #fff;
  325. background: #f1c554;
  326. border-radius: 100rpx;
  327. }
  328. .border-bottom {
  329. border-bottom: 1px solid #D8D8D8;
  330. }
  331. .cu-form-group {
  332. padding-top: 15px;
  333. }
  334. .yellow {
  335. color: #f5cc57;
  336. }
  337. </style>