popup.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <template>
  2. <view>
  3. <!-- 弹窗 -->
  4. <view class="bgbox" @click="getClose" v-if="type"></view>
  5. <!-- 实名认证 -->
  6. <view v-if="type=='tips'" class="assignbox atips">
  7. <image :src="tiprz" class="tiprz"></image>
  8. <view class="assbox">
  9. <view class="asstips">
  10. <view class="tit">温馨提示</view>
  11. <view class="txt">您还未进行实名认证,认证即可接单</view>
  12. </view>
  13. <view class="rhbtn mlr4" @click="getSure">去实名认证</view>
  14. </view>
  15. <image :src="closeimg" class="closeimg" @click="getClose"></image>
  16. </view>
  17. <!-- 取消订单 -->
  18. <view v-if="type=='cancel'" class="assignbox cancel">
  19. <view class="assbox">
  20. <view class="asstit mb18">取消订单</view>
  21. <view class="pb16">
  22. <view class="canceltxt">您确定取消该订单吗?</view>
  23. <view class="canceltxt">如若取消,则需缴纳罚单<text class="cofe">¥20</text></view>
  24. <view class="cantips mt18 mb13">
  25. <text class="cof4">*</text> 取消原因
  26. </view>
  27. <view class="canlists" v-for="(ite,idx) in canres" :key="idx" @click="getTabFn(ite.val)">
  28. <image :src="chose" v-if="tabval==ite.val"></image>
  29. <image :src="nchose" v-else></image>
  30. {{ite.tit}}
  31. </view>
  32. </view>
  33. <view class="rhbtn" @click="getSure">确认取消</view>
  34. </view>
  35. <image :src="closeimg" class="closeimg" @click="getClose"></image>
  36. </view>
  37. <!-- 拍照 -->
  38. <view v-if="type=='addpho'" class="assignbox pra">
  39. <view class="assbox">
  40. <view class="asstit">{{finshtype==2?'完成打卡':'上门打卡'}}</view>
  41. <view class="assadd">
  42. <image :src="addpho"></image>
  43. <view>去拍照</view>
  44. </view>
  45. <view class="assimgs">
  46. <view class="assimg">
  47. <image :src="headbg" class="img"></image>
  48. <image :src="rdelimg" class="delimg" @click="getDelFn"></image>
  49. </view>
  50. <view class="assimg">
  51. <image :src="headbg" class="img"></image>
  52. <image :src="rdelimg" class="delimg" @click="getDelFn"></image>
  53. </view>
  54. <view class="assimg">
  55. <image :src="headbg" class="img"></image>
  56. <image :src="rdelimg" class="delimg" @click="getDelFn"></image>
  57. </view>
  58. </view>
  59. <view class="rhbtn" @click="getSure">确定</view>
  60. </view>
  61. <image :src="closeimg" class="closeimg" @click="getClose"></image>
  62. </view>
  63. <!-- 二维码 -->
  64. <view v-if="type=='minecode'" class="mcode">
  65. <view class="asstop flex1">
  66. <view class="flexe">
  67. <image :src="closeimg" class="closes" @click="getClose"></image>
  68. </view>
  69. <view class="codetit">我的二维码</view>
  70. <view class="assbox">
  71. <view class="mtop flexc">
  72. <image :src="headimg" class="head flex0"></image>袁明朗
  73. <image :src="rzico" class="rzimg flex0"></image>
  74. </view>
  75. <view class="codes">
  76. <image :src="headimg" class="codes"></image>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="sharebox flexcc">
  81. <view class="shbox">
  82. <image :src="sharea"></image>
  83. <view>微信好友</view>
  84. </view>
  85. <view class="shbox">
  86. <image :src="shareb"></image>
  87. <view>微信朋友圈</view>
  88. </view>
  89. <view class="shbox">
  90. <image :src="down"></image>
  91. <view>保存图片</view>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </template>
  97. <script>
  98. import config from '@/config'
  99. const baseUrl = config.baseUrl
  100. import { getToken } from '@/utils/auth'
  101. import {uploadmore} from '@/utils/common.js'
  102. export default{
  103. components:{},
  104. props:{
  105. type: {
  106. type: String,
  107. default () {
  108. return ''
  109. }
  110. },
  111. canres:{
  112. type: Array,
  113. default () {
  114. return []
  115. }
  116. },
  117. finshtype:{
  118. type: [String,Number],
  119. default () {
  120. return ''
  121. }
  122. }
  123. },
  124. data(){
  125. return{
  126. baseUrl:config.baseUrl,
  127. closeimg:require("@/static/images/close.png"),
  128. // rimg: require('@/work/static/people/rimg.png'),
  129. // headbg: require('@/work/static/service/headbg.png'),
  130. addpho: require('@/static/images/addpho.png'),
  131. rdelimg: require('@/static/images/rdel.png'),
  132. tiprz: require('@/static/images/home/tiprz.png'),
  133. chose: require('@/static/images/home/chose.png'),
  134. nchose: require('@/static/images/home/nchose.png'),
  135. headimg:require("@/static/images/mine/profile.png"),
  136. rzico:require("@/static/images/mine/rzico.png"),
  137. down:require("@/static/images/mine/down.png"),
  138. sharea:require("@/static/images/mine/sharea.png"),
  139. shareb:require("@/static/images/mine/shareb.png"),
  140. datainfo:{
  141. iszc:""
  142. },
  143. sexs: [{
  144. text: '男',
  145. value: 0
  146. }, {
  147. text: '女',
  148. value: 1
  149. }],
  150. tabval:0,
  151. }
  152. },
  153. mounted() {
  154. this.baseUrl=baseUrl
  155. },
  156. watch:{
  157. type(val){
  158. // this.filelist=[];
  159. // this.shtext='';
  160. // this.isty='2';
  161. // this.phofile=[];
  162. }
  163. },
  164. methods:{
  165. bindDateChange(){
  166. var val=e.detail.value;
  167. },
  168. getClose(){
  169. this.$emit('getClose')
  170. },
  171. getSure(){
  172. this.$emit('getSure')
  173. },
  174. getTabFn(val){
  175. this.tabval=val
  176. },
  177. getChose(val){
  178. this.peoval=val
  179. },
  180. getPreviewImage(arr,idx){
  181. var newArr=[];
  182. arr.forEach(ite=>{
  183. var ds=this.baseUrl+ite
  184. newArr.push(ds)
  185. })
  186. uni.previewImage({
  187. urls: newArr,
  188. current:idx,
  189. success: function(data) {
  190. },
  191. fail: function(err) {
  192. }
  193. });
  194. },
  195. getDelFn(){
  196. var that=this;
  197. uni.showModal({
  198. title: '确认删除',
  199. content: "是否确认删除",
  200. cancelText: '取消',
  201. confirmText: '确认',
  202. success: function(res) {
  203. if (res.confirm) {
  204. // that.filelist.splice(idx,1)
  205. } else if (res.cancel) {
  206. }
  207. }
  208. });
  209. },
  210. getaddImage(e){
  211. let that = this;
  212. let file =[],count=9
  213. uni.chooseImage({
  214. count: 1,
  215. success:function(res){
  216. let img= res.tempFilePaths;
  217. if(img.length + file.length > count){
  218. uni.showToast({
  219. title: '最多上传'+count+'张图片',
  220. icon: 'none',
  221. duration: 2000
  222. })
  223. }else{
  224. let imglen = res.tempFilePaths.length;
  225. var fuwufile = [];
  226. uploadmore('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
  227. var resurl=rs[0];
  228. // if(e=='front'){
  229. // that.datainfo.front=resurl.fileName;
  230. // }else{
  231. // that.datainfo.back=resurl.fileName;
  232. // }
  233. })
  234. }
  235. }
  236. });
  237. },
  238. }
  239. }
  240. </script>
  241. <style lang="scss" scoped>
  242. .assignbox{background: #FFFFFF;border-radius: 20rpx;position: fixed;left:140rpx;right:140rpx;z-index: 10;top: 50%;transform: translateY(-50%);padding:32rpx 36rpx 36rpx;
  243. .assbox{max-height: calc(100vh - 300rpx);overflow: auto;}
  244. .asstit{font-weight: bold;font-size: 30rpx;color: #272727;text-align: center;padding-left: 16rpx;margin-bottom: 28rpx;}
  245. // 取消订单
  246. &.cancel{padding-bottom: 40rpx;
  247. .canceltxt{font-weight: 500;text-align: center;
  248. font-size: 30rpx;
  249. color: #272727;}
  250. .cantips{font-weight: bold;font-size: 26rpx;color: #272727;
  251. text{margin-right: 6rpx;}
  252. }
  253. .canlists{font-weight: 500;font-size: 26rpx;color: #666666;padding-left: 18px;margin-bottom: 20rpx;
  254. image{width: 20rpx;height: 20rpx;margin-right: 16rpx;flex: 0 0 auto;margin-top: 7rpx;}
  255. }
  256. }
  257. // 温馨提示
  258. &.atips{min-height: 348rpx;background: linear-gradient(180deg, #E8F2FF 0%, #FFFFFF 65%);padding: 32rpx 28rpx 36rpx;
  259. border-radius: 10px;}
  260. .tiprz{width: 112rpx;height: 130rpx;position: absolute;left: 50%;top: -42rpx;margin-left: -56rpx;}
  261. .asstips{padding-top: 40rpx;
  262. .tit{font-weight: bold;font-size: 30rpx;color: #272727;margin-bottom: 24rpx;}
  263. .txt{font-weight: 500;font-size: 26rpx;color: #272727;margin-bottom: 20rpx;min-height: 72rpx;}
  264. }
  265. // 上传图片
  266. &.pra{}
  267. .assadd{display: flex;flex-direction: column;align-items: center;justify-content: center;border-radius: 10rpx;height: 192rpx;
  268. border: 2rpx dashed #A7A7A7;box-sizing: border-box;margin-bottom: 32rpx;
  269. image{width:48rpx;height: 40rpx;margin-bottom: 16rpx;}
  270. view{font-weight: bold;font-size: 26rpx;color: #272727;}
  271. }
  272. .assimgs{display: flex;align-items: center;flex-wrap: wrap;margin-bottom: 8rpx;
  273. .assimg{width: 140rpx;height: 140rpx;position: relative;overflow: hidden;margin: 0 24rpx 24rpx 0;
  274. &:nth-of-type(3n){margin-right: 0;}
  275. .img{width: 100%;height: 100%;}
  276. .delimg{width: 24rpx;height: 24rpx;position: absolute;right: 0;top: 0;}
  277. }
  278. }
  279. }
  280. // 二维码
  281. .mcode{background-color: transparent;left: 0rpx;right: 0;top: 0;bottom: 0;position: fixed;z-index: 10;box-sizing: border-box;display: flex;flex-direction: column;padding-bottom: 100rpx;align-items: center;overflow: auto;
  282. .asstop{margin-bottom: 40rpx;display: flex;flex-direction: column;justify-content: center;
  283. width: 566rpx;position: relative;
  284. .closes{width: 30rpx;height: 30rpx;margin-bottom: 100rpx;}
  285. .codetit{font-weight: bold;font-size: 26rpx;color: #FFFFFF;margin-bottom: 76rpx;text-align: center;}
  286. .assbox{background: #FFFFFF;border-radius: 20rpx;padding: 56rpx 88rpx 88rpx;
  287. .codes{width: 384rpx;height: 384rpx;}
  288. }
  289. .mtop{font-weight: bold;font-size: 30rpx;color: #272727;margin-bottom: 68rpx;
  290. .head{width: 56rpx;height: 56rpx;margin-right: 32rpx;border-radius: 50%;}
  291. .rzimg{width: 64rpx;height: 22rpx;margin-left: 18rpx;}
  292. }
  293. }
  294. .sharebox{flex: 0 0 auto;
  295. .shbox{display: flex;flex-direction: column;align-items: center;padding: 0 22rpx;margin: 0 26rpx;
  296. image{width: 90rpx;height: 90rpx;}
  297. view{font-weight: 500;font-size: 24rpx;color: #DFDFDF;}
  298. }
  299. }
  300. }
  301. .closeimg{width: 32rpx;height: 32rpx;position: absolute;bottom: -62rpx;left: 50%;margin-left: -16rpx;}
  302. </style>