orderallot-detail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <view>
  3. <block v-if="detail != null">
  4. <view class="padding-horizontal-main padding-top-main">
  5. <!-- 地址 -->
  6. <view v-if="(detail.order_type == 0 || detail.order_type == 1 || detail.order_type == 2) && (detail.address_data || null) != null" class="address bg-white padding-horizontal-main padding-top-main border-radius-main spacing-mb">
  7. <view class="address-base oh">
  8. <text v-if="(detail.address_data.alias || null) != null" class="address-alias round br-main cr-main bg-white margin-right-sm">{{detail.address_data.alias}}</text>
  9. <text>{{detail.address_data.name}}</text>
  10. <text class="fr">{{detail.address_data.tel}}</text>
  11. </view>
  12. <view class="address-detail oh margin-bottom-main">
  13. <image class="icon fl" :src="common_static_url+'map-icon.png'" mode="widthFix"></image>
  14. <view class="text fr">
  15. <text>{{detail.address_data.province_name}}{{detail.address_data.city_name}}{{detail.address_data.county_name}}{{detail.address_data.address}}</text>
  16. <text v-if="detail.order_model == 2 && (detail.address_data.lng || 0) != 0 && (detail.address_data.lat || 0 && detail.address_data.lng != 0 && detail.address_data.lat != 0) != 0" class="address-map-submit cr-base br round bg-white margin-left-sm text-size-xs" @tap="address_map_event">查看位置</text>
  17. </view>
  18. </view>
  19. <view class="address-divider spacing-mb"></view>
  20. </view>
  21. <!-- 商品列表 -->
  22. <view class="goods bg-white padding-main border-radius-main spacing-mb">
  23. <view class="br-b padding-bottom-main fw-b text-size">商品信息</view>
  24. <view v-for="(item, index) in detail.items" :key="index" class="goods-item br-b-dashed oh padding-main">
  25. <navigator :url="item.goods_url" hover-class="none">
  26. <image class="goods-image fl radius" :src="item.images" mode="aspectFill"></image>
  27. <view class="goods-base pr">
  28. <view class="multi-text">{{item.title}}</view>
  29. <view v-if="item.spec != null" class="margin-top-sm">
  30. <block v-for="(sv, si) in item.spec" :key="si">
  31. <text v-if="si > 0" class="cr-grey padding-left-xs padding-right-xs">;</text>
  32. <text class="cr-gray">{{sv.value}}</text>
  33. </block>
  34. </view>
  35. <view class="margin-top-sm">
  36. <text class="fw-b">{{detail.currency_data.currency_symbol}}{{item.price}}</text>
  37. <text class="margin-left-sm">x{{item.buy_number}}</text>
  38. </view>
  39. </view>
  40. </navigator>
  41. </view>
  42. <view class="padding-top-main tr cr-base text-size">
  43. <text>共<text class="fw-b">{{detail.buy_number_count}}</text>件 合计 <text class="sales-price margin-right-xs">{{detail.currency_data.currency_symbol}}{{detail.total_price}}</text>元</text>
  44. </view>
  45. </view>
  46. <!-- 虚拟销售数据 -->
  47. <view v-if="(site_fictitious || null) != null" class="site-fictitious panel-item padding-horizontal-main padding-top-main border-radius-main bg-white spacing-mb">
  48. <view class="br-b padding-bottom-main fw-b text-size">{{site_fictitious.title || item.fictitious_goods_title}}</view>
  49. <view class="panel-content oh padding-top-main">
  50. <view v-if="(site_fictitious.tips || null) != null" class="tips-value radius padding-main margin-bottom-main">
  51. <mp-html :content="site_fictitious.tips" />
  52. </view>
  53. <view v-for="(item, index) in detail.items" :key="index" class="item br-b-dashed oh padding-bottom-main margin-bottom-main">
  54. <image class="left-image br fl radius" :src="item.images" mode="aspectFill"></image>
  55. <view class="right-value fr">
  56. <mp-html v-if="(item.fictitious_goods_value || null) != null" :content="item.fictitious_goods_value" />
  57. <text v-else class="cr-gray">未配置数据</text>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. <!-- 自提信息 -->
  63. <view v-if="(detail.extraction_data || null) != null" class="site-extraction panel-item padding-main border-radius-main bg-white spacing-mb">
  64. <view class="br-b padding-bottom-main fw-b text-size">取货信息</view>
  65. <view class="panel-content oh padding-top-main">
  66. <view>
  67. <text>取货码:</text>
  68. <text class="radius bg-green cr-white padding-left-sm padding-right-sm">{{detail.extraction_data.code || '取货码不存在、请联系管理员'}}</text>
  69. </view>
  70. <image v-if="(detail.extraction_data.images || null) != null" class="qrcode br radius margin-top-lg" :src="detail.extraction_data.images" mode="aspectFill"></image>
  71. </view>
  72. </view>
  73. <!-- 订单基础数据 -->
  74. <view v-if="detail_list.length > 0" class="panel-item padding-main border-radius-main bg-white spacing-mb">
  75. <view class="br-b padding-bottom-main fw-b text-size">订单信息</view>
  76. <view class="panel-content oh">
  77. <view v-for="(item, index) in detail_list" :key="index" class="item br-b oh padding-vertical-main">
  78. <view class="title fl padding-right-main cr-gray">{{item.name}}</view>
  79. <view class="content fl br-l padding-left-main">{{item.value}}</view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. <!-- 结尾 -->
  85. <component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
  86. </block>
  87. <block v-else>
  88. <!-- 提示信息 -->
  89. <component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
  90. </block>
  91. </view>
  92. </template>
  93. <script>
  94. const app = getApp();
  95. import componentNoData from "../../../../components/no-data/no-data";
  96. import componentBottomLine from "../../../../components/bottom-line/bottom-line";
  97. var common_static_url = app.globalData.get_static_url('common');
  98. export default {
  99. data() {
  100. return {
  101. common_static_url: common_static_url,
  102. params: null,
  103. data_list_loding_status: 1,
  104. data_list_loding_msg: '',
  105. data_bottom_line_status: false,
  106. detail: null,
  107. detail_list: [],
  108. site_fictitious: null
  109. };
  110. },
  111. components: {
  112. componentNoData,
  113. componentBottomLine
  114. },
  115. props: {},
  116. onLoad(params) {
  117. //params['id'] = 5;
  118. this.setData({
  119. params: params
  120. });
  121. },
  122. onShow() {
  123. // 数据加载
  124. this.init();
  125. // 分享菜单处理
  126. app.globalData.page_share_handle();
  127. },
  128. // 下拉刷新
  129. onPullDownRefresh() {
  130. this.init();
  131. },
  132. methods: {
  133. // 获取数据
  134. init() {
  135. var self = this;
  136. uni.showLoading({
  137. title: '加载中...'
  138. });
  139. this.setData({
  140. data_list_loding_status: 1
  141. });
  142. uni.request({
  143. url: app.globalData.get_request_url("detail", "orderallot", "realstore"),
  144. method: 'POST',
  145. data: {
  146. id: this.params.id
  147. },
  148. dataType: 'json',
  149. success: res => {
  150. uni.hideLoading();
  151. uni.stopPullDownRefresh();
  152. if (res.data.code == 0) {
  153. var data = res.data.data;
  154. self.setData({
  155. detail: data.data,
  156. detail_list:[
  157. {name: "订单类型", value: data.data.order_type_name || ''},
  158. {name: "订单编号", value: data.data.order_allot_no || ''},
  159. {name: "订单状态", value: data.data.status_name || ''},
  160. {name: "订单总价", value: data.data.total_price || ''},
  161. {name: "创建时间", value: data.data.add_time || ''},
  162. {name: "添加时间", value: data.data.add_time || ''},
  163. {name: "接收时间", value: data.data.receive_time || ''},
  164. {name: "服务时间", value: data.data.service_time || ''},
  165. {name: "完成时间", value: data.data.success_time || ''},
  166. {name: "取消时间", value: data.data.cancel_time || ''},
  167. ],
  168. site_fictitious: data.site_fictitious || null,
  169. data_list_loding_status: 3,
  170. data_bottom_line_status: true,
  171. data_list_loding_msg: ''
  172. });
  173. } else {
  174. self.setData({
  175. data_list_loding_status: 2,
  176. data_bottom_line_status: false,
  177. data_list_loding_msg: res.data.msg
  178. });
  179. if (app.globalData.is_login_check(res.data, self, 'init')) {
  180. app.globalData.showToast(res.data.msg);
  181. }
  182. }
  183. },
  184. fail: () => {
  185. uni.hideLoading();
  186. uni.stopPullDownRefresh();
  187. self.setData({
  188. data_list_loding_status: 2,
  189. data_bottom_line_status: false,
  190. data_list_loding_msg: '服务器请求出错'
  191. });
  192. app.globalData.showToast('服务器请求出错');
  193. }
  194. });
  195. },
  196. // 地图查看
  197. address_map_event(e) {
  198. if ((this.detail.address_data || null) == null) {
  199. app.globalData.showToast("地址有误");
  200. return false;
  201. }
  202. // 打开地图
  203. var data = this.detail.address_data;
  204. var name = data.alias || data.name || '';
  205. var address = (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data.address || '');
  206. app.globalData.open_location(data.lng, data.lat, name, address);
  207. }
  208. }
  209. };
  210. </script>
  211. <style>
  212. @import './orderallot-detail.css';
  213. </style>