app-shipping-address.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <view class="app-view">
  3. <view class="app-information">
  4. <!-- <view class="app-contact-information main-between">
  5. <text>收货人:{{item.name}}</text>
  6. <text>{{item.mobile}}</text>
  7. </view>
  8. <text>收货地址: {{item.address}}</text> -->
  9. <view class="">
  10. <view class="felx-three">
  11. <view class="box-grow-2">
  12. 参训人: {{verifyUndefined(item.name)}}
  13. </view>
  14. <view class="box-grow-3">
  15. 性别: {{verifyUndefined(item.sex) == ''? '':item.sex == 0 ?'未知':item.sex == 1? '男':'女'}}
  16. </view>
  17. <view class="box-grow-4">
  18. 联系电话: {{verifyUndefined(item.mobile)}}
  19. </view>
  20. </view>
  21. <view class="felx-three">
  22. <view class="box-grow-2">
  23. 年龄: {{verifyUndefined(item.age)}}
  24. </view>
  25. <view class="box-grow-3">
  26. 体重: {{verifyUndefined(item.weight)}}
  27. </view>
  28. <view class="box-grow-4">
  29. 身高: {{verifyUndefined(item.height)}}
  30. </view>
  31. </view>
  32. <view class="felx-three">
  33. <view class="box-grow-5">
  34. 身份证号码:{{verifyUndefined(item.idcard)}}
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <view @click.stop="editStop" class="app-operating dir-left-nowrap cross-center">
  40. <view v-if="is_hide_default_btn" class="dir-left-nowrap cross-center">
  41. <view class="app-radio">
  42. <!-- <radio color="red" class="radio"></radio>-->
  43. <app-radio @click.stop="changeDefault" width="32" height="32" v-model="item.is_default == 1"
  44. type="round"></app-radio>
  45. </view>
  46. <text class="app-text app-text-color-default" v-if="item.is_default === `0`">设为默认</text>
  47. <text class="app-text app-text-color-selection" v-else-if="item.is_default === `1`">
  48. 已设为默认
  49. </text>
  50. </view>
  51. <view class="app-operating-view dir-left-nowrap cross-center main-between">
  52. <view @click.stop="edit" class="app-modify dir-left-nowrap cross-center main-between">
  53. <icon class="app-icon app-modify-icon"></icon>
  54. <text>编辑</text>
  55. </view>
  56. <view @click.stop="destroy" class="app-delete dir-left-nowrap cross-center main-between">
  57. <icon class="app-icon app-delete-icon"></icon>
  58. <text>删除</text>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. import appRadio from '../../basic-component/app-radio/app-radio.vue';
  66. export default {
  67. name: "app-shipping-address",
  68. components: {appRadio},
  69. props: {
  70. item: {
  71. type: Object,
  72. },
  73. is_hide_default_btn: {
  74. type: Boolean,
  75. default: false,
  76. },
  77. destroy_url: {
  78. type: String,
  79. default: ''
  80. },
  81. is_refund_address: {
  82. type: Number,
  83. default: 0,
  84. }
  85. },
  86. methods: {
  87. verifyUndefined(value){
  88. if(typeof(value) == 'undefined' || value == '' || value == 'undefined'){
  89. return ''
  90. }else{
  91. return value
  92. }
  93. },
  94. changeDefault() {
  95. const self = this;
  96. self.$request({
  97. url: self.$api.user.address_default,
  98. method: 'POST',
  99. data: {
  100. id: self.item.id,
  101. is_default: self.item.is_default == 1 ? 0 : 1,
  102. }
  103. }).then((info) => {
  104. if (info.code === 0) {
  105. self.$emit('handleAddress', 'price-sort-default.png')
  106. } else {
  107. uni.showToast({title: info.msg, icon: 'none'})
  108. }
  109. }).catch(() => {
  110. })
  111. },
  112. edit() {
  113. uni.navigateTo({url: `/pages/address/address-edit?id=` + this.item.id + '&is_refund_address=' + this.is_refund_address});
  114. },
  115. editStop(){
  116. this.$emit('handleStop', 'editStop')
  117. },
  118. destroy() {
  119. const self = this;
  120. uni.showModal({
  121. content: '确定删除报名信息吗?',
  122. success: function (res) {
  123. if (res.confirm) {
  124. self.$request({
  125. url: self.destroy_url,
  126. method: 'POST',
  127. data: {
  128. id: self.item.id,
  129. }
  130. }).then((info) => {
  131. if (info.code === 0) {
  132. self.$emit('handleAddress', 'delete')
  133. } else {
  134. uni.showToast({title: info.msg, icon: 'none'})
  135. }
  136. }).catch(() => {
  137. })
  138. } else if (res.cancel) {
  139. }
  140. }
  141. });
  142. },
  143. }
  144. }
  145. </script>
  146. <style scoped lang="scss">
  147. .felx-three{
  148. display: flex;
  149. align-items: center;
  150. justify-content: space-around;
  151. padding-bottom: 23rpx;
  152. .box-grow-2, .box-grow-3, .box-grow-4{
  153. font-size: 24rpx;
  154. font-family: Source Han Sans CN;
  155. font-weight: 400;
  156. color: rgba(100,100,100,1);
  157. overflow: hidden;
  158. text-overflow: ellipsis;
  159. white-space: nowrap;
  160. }
  161. .box-grow-2{
  162. width: 30%;
  163. }
  164. .box-grow-3{
  165. width: 30%;
  166. }
  167. .box-grow-4{
  168. width: 40%;
  169. }
  170. .box-grow-5{
  171. width: 100%;
  172. font-size: 24rpx;
  173. font-family: Source Han Sans CN;
  174. font-weight: 400;
  175. color: rgba(100,100,100,1);
  176. overflow: hidden;
  177. text-overflow: ellipsis;
  178. white-space: nowrap;
  179. }
  180. }
  181. text {
  182. font-size: #{28rpx};
  183. color: #353535;
  184. }
  185. .radio {
  186. width: #{32upx};
  187. height: #{32upx};
  188. }
  189. .app-view {
  190. margin-top: #{20rpx};
  191. margin-bottom: #{20rpx};
  192. margin-left: #{24rpx};
  193. margin-right: #{24rpx};
  194. background: #FFFFFF;
  195. border-radius: #{16rpx};
  196. .app-information {
  197. padding: #{32rpx} #{24rpx};
  198. border-bottom: #{1rpx} solid #e2e2e2;
  199. .app-contact-information {
  200. margin-bottom: #{24rpx};
  201. }
  202. }
  203. .app-operating {
  204. margin-top: #{24rpx};
  205. padding-bottom: #{24rpx};
  206. .app-radio {
  207. margin-left: #{24rpx};
  208. margin-right: #{20rpx};
  209. }
  210. .app-text {
  211. font-size: #{28rpx};
  212. }
  213. .app-text-color-default {
  214. color: #999999;
  215. }
  216. .app-text-color-selection {
  217. color: #ff4544;
  218. }
  219. .app-operating-view {
  220. margin-left: auto;
  221. right: #{24rpx};
  222. width: #{106rpx + 106rpx + 48rpx + 24rpx};
  223. height: #{32rpx};
  224. text {
  225. color: #999999;
  226. }
  227. .app-modify {
  228. width: #{106rpx};
  229. }
  230. .app-delete {
  231. width: #{106rpx};
  232. margin-right:#{24rpx};
  233. }
  234. .app-icon {
  235. width: #{32rpx};
  236. height: #{32rpx};
  237. background-size: 100% 100%;
  238. background-repeat: no-repeat;
  239. }
  240. .app-modify-icon {
  241. background-image: url("../../../static/image/icon/modify.png");
  242. }
  243. .app-delete-icon {
  244. background-image: url("../../../static/image/icon/delete.png");
  245. }
  246. }
  247. }
  248. }
  249. </style>