male.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <template>
  2. <view class="content">
  3. <view class="box">
  4. <view class="title" style="margin-top: 0;">{{ $t('foo.yhzzyz') }}</view>
  5. <view class="detail">
  6. <view class="detail-spe">{{ $t('foo.zsxm') }}:{{ name }}</view>
  7. <view class="detail-spe">
  8. {{ $t('foo.yhylsjh') }}:{{ phone }}
  9. <view class="copyband" @click="copy(yhylsjh)">{{ $t('foo.fzsjh') }}</view>
  10. </view>
  11. <view class="detail-item">
  12. {{ $t('foo.yhzh') }}:{{ bank_card_no }}
  13. <view class="copy" @click="copy(bank_card_no)">{{ $t('foo.fzzh') }}</view>
  14. </view>
  15. <view class="detail-spe">
  16. {{ $t('foo.khh') }}:{{ bank_of_deposit }}
  17. <view class="copyband" @click="copy(bank_of_deposit)">{{ $t('foo.fzkhh') }}</view>
  18. </view>
  19. </view>
  20. <view v-if="ali != ''">
  21. <view class="title">{{ $t('foo.zfbsmyz') }}</view>
  22. <view class="erweima" @click="open(1)"><image :src="ali" mode="widthFix"></image></view>
  23. <view class="btn" @click="down(1)">{{ $t('foo.xzewm') }}</view>
  24. </view>
  25. <view v-if="wechat != ''">
  26. <view class="title">{{ $t('foo.wxsmyz') }}</view>
  27. <view class="erweima" @click="open(2)"><image :src="wechat" mode="widthFix"></image></view>
  28. <view class="btn" @click="down(2)">{{ $t('foo.xzewm') }}</view>
  29. </view>
  30. </view>
  31. <uni-popup ref="popup" type="center">
  32. <movable-area class="popup-box">
  33. <movable-view class="popup-item" :scale="true" direction="all"><image :src="img" mode=""></image></movable-view>
  34. </movable-area>
  35. </uni-popup>
  36. </view>
  37. </template>
  38. <script>
  39. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  40. import { mapState, mapMutations } from 'vuex';
  41. export default {
  42. components: {
  43. uniPopup
  44. },
  45. computed: {
  46. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  47. },
  48. data(){
  49. return {
  50. img:'',
  51. ali:'',
  52. wechat:'',
  53. bank_card_no:'',
  54. bank_of_deposit:'',
  55. name:'',
  56. phone:'',
  57. downing: false
  58. }
  59. },
  60. onLoad(option) {
  61. console.log(option)
  62. if(option.ali != ''){
  63. this.ali = option.ali
  64. }
  65. if(option.wei != ''){
  66. this.wechat = option.wei
  67. }
  68. if(option.bank != ''){
  69. this.bank_of_deposit = option.bank
  70. }
  71. if(option.info != ''){
  72. this.bank_card_no = option.info
  73. }
  74. if(option.name != ''){
  75. this.name = option.name
  76. }
  77. if(option.phone != ''){
  78. this.phone = option.phone
  79. }
  80. uni.setNavigationBarTitle({
  81. title:this.$t('foo.xq')
  82. })
  83. },
  84. methods: {
  85. copy(text) {
  86. uni.setClipboardData({
  87. data: text,
  88. success: e => {
  89. uni.showToast({
  90. title: this.$t('foo.fzcg')
  91. });
  92. },
  93. fail(e) {
  94. uni.showToast({
  95. title: this.$t('foo.fzcg.fzsb'),
  96. icon: false
  97. });
  98. console.log(e);
  99. }
  100. });
  101. },
  102. open(type){
  103. if(type == 1){
  104. this.img = this.ali
  105. }else {
  106. this.img = this.wechat
  107. }
  108. this.$refs.popup.open();
  109. },
  110. down(type){
  111. if(type == 1){
  112. this.img = this.ali
  113. }else {
  114. this.img = this.wechat
  115. }
  116. if(this.downing){
  117. return
  118. }
  119. this.downing = true
  120. uni.downloadFile({
  121. url: this.img,
  122. success: res => {
  123. if (res.statusCode === 200){
  124. uni.saveImageToPhotosAlbum({
  125. filePath: res.tempFilePath,
  126. success: function(e) {
  127. console.log(e,'保存路径')
  128. uni.showToast({
  129. title: "保存成功",
  130. icon: true
  131. });
  132. this.downing = false
  133. },
  134. fail: function() {
  135. uni.showToast({
  136. title: "保存失败",
  137. icon: false
  138. });
  139. this.downing = false
  140. }
  141. });
  142. }
  143. this.downing = false
  144. },
  145. fail(e) {
  146. uni.showToast({
  147. title: '复制失败',
  148. icon: false
  149. });
  150. this.downing = false
  151. console.log(e);
  152. }
  153. });
  154. }
  155. }
  156. };
  157. </script>
  158. <style lang="scss">
  159. body,
  160. page {
  161. height: 100%;
  162. background-color: #000;
  163. }
  164. .content {
  165. background-color: #000;
  166. line-height: 1;
  167. padding-top: 25rpx;
  168. padding: 24rpx 24rpx 90rpx;
  169. .cross {
  170. margin-left: 6rpx;
  171. height: 76rpx;
  172. line-height: 76rpx;
  173. color: #444444;
  174. border-bottom: 1rpx solid #cccccc;
  175. }
  176. .image {
  177. margin-top: 44rpx;
  178. margin-bottom: 48rpx;
  179. height: 404rpx;
  180. width: 100%;
  181. image {
  182. width: 100%;
  183. height: 100%;
  184. }
  185. }
  186. .box {
  187. padding: 20rpx 0 24rpx;
  188. color: #fff;
  189. .title {
  190. margin-top: 60rpx;
  191. font-size: 28rpx;
  192. font-family: PingFang SC;
  193. font-weight: bold;
  194. }
  195. .detail {
  196. padding-top: 10rpx;
  197. font-size: 28rpx;
  198. line-height: 40rpx;
  199. .detail-spe {
  200. margin-top: 10rpx;
  201. line-height: 46rpx;
  202. overflow: hidden;
  203. text-overflow: ellipsis;
  204. display: -webkit-box; //必须结合的属性,将对象作为弹性伸缩盒子模型显示
  205. -webkit-line-clamp: 2; //控制文本的行数
  206. -webkit-box-orient: vertical; //必须结合的属性,设置或检索伸缩盒对象的子元素的排列方式
  207. .copyband {
  208. display: flex;
  209. float: right;
  210. // float: right;
  211. justify-content: center;
  212. border-radius: 10rpx;
  213. line-height: 34rpx;
  214. font-size: 24rpx;
  215. color: #fff;
  216. // padding: 0 24rpx;
  217. width: 168rpx;
  218. height: 34rpx;
  219. margin-top: 8rpx;
  220. }
  221. }
  222. .detail-item {
  223. display: flex;
  224. justify-content: space-between;
  225. align-items: center;
  226. // height: 40rpx;
  227. line-height: 46rpx;
  228. color: #fff;
  229. margin-top: 10rpx;
  230. .copy {
  231. width: 168rpx;
  232. display: flex;
  233. justify-content: center;
  234. background-color: #f1f1f1;
  235. border-radius: 10rpx;
  236. line-height: 34rpx;
  237. font-size: 24rpx;
  238. color: #333;
  239. padding: 0 24rpx;
  240. // width: 144rpx;
  241. height: 34rpx;
  242. }
  243. }
  244. }
  245. .erweima {
  246. width: 362rpx;
  247. margin: 26rpx auto;
  248. image {
  249. width: 100%;
  250. }
  251. }
  252. .zfb {
  253. font-size: 30rpx;
  254. font-family: PingFang SC;
  255. font-weight: bold;
  256. color: #0b9edd;
  257. margin-top: 36rpx;
  258. text-align: center;
  259. }
  260. .weixin {
  261. font-size: 30rpx;
  262. font-family: PingFang SC;
  263. font-weight: bold;
  264. color: #02974a;
  265. margin-top: 36rpx;
  266. text-align: center;
  267. }
  268. }
  269. }
  270. .popup-box {
  271. width: 522rpx;
  272. height: 605rpx;
  273. border-radius: 20rpx;
  274. position: relative;
  275. .popup-item {
  276. width: 100%;
  277. height: 100%;
  278. image {
  279. width: 100%;
  280. height: 100%;
  281. }
  282. }
  283. }
  284. .btn {
  285. margin: 50rpx auto 0;
  286. width: 500rpx;
  287. height: 60rpx;
  288. background: linear-gradient(-74deg, #ce9c6d, #ffecd6);
  289. border-image: linear-gradient(115deg, #feebd5, #ffffff, #e1ad7d) 1 1;
  290. border-radius: 30px;
  291. line-height: 60rpx;
  292. text-align: center;
  293. font-size: 26rpx;
  294. font-family: PingFang SC;
  295. font-weight: 500;
  296. color: #643912;
  297. }
  298. </style>