details.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <template>
  2. <view>
  3. <view style="width: 100%;height: 750rpx;">
  4. <image :src="form.url" mode="aspectFit" style="width: 100%;height: 750rpx;" />
  5. </view>
  6. <view style="background-color: #fff;padding: 43rpx 65rpx;margin-bottom: 20rpx;">
  7. <view style="display: flex;justify-content: space-between;">
  8. <view style="display: flex;color: #03803B;font-size: 40rpx;align-items: flex-end;">
  9. <view style="font-size: 26rpx;height: 40rpx;">
  10. </view>
  11. <view style="font-size: 40rpx;">
  12. {{ checkStatus == '审核通过' ? form.price|| 0 :'***'}}
  13. </view>
  14. </view>
  15. <!-- <view style="display: flex;align-items: center;">
  16. <view style="display: flex;align-items: center;margin-right: 10rpx;">
  17. <image v-if="Number(form.balanceQuantity)" src="/static/images/goods/11.png"
  18. mode="aspectFit" style="width: 102rpx;height: 36rpx;" />
  19. <image v-if="Number(form.balanceQuantity)==0" src="/static/images/goods/14.png"
  20. mode="aspectFit" style="width: 102rpx;height: 36rpx;" />
  21. <view style="font-size: 24rpx;color: #C4C4C4;margin-left: 10rpx;">
  22. :{{ form.balanceQuantity ? Number(form.balanceQuantity) > 10 ? '充足' : form.balanceQuantity : '' }}
  23. </view>
  24. </view>
  25. <view style="display: flex;align-items: center;">
  26. <image v-if="Number(form.total)" src="/static/images/goods/12.png"
  27. mode="aspectFit" style="width: 102rpx;height: 36rpx;" />
  28. <image v-if="Number(form.total)==0" src="/static/images/goods/15.png"
  29. mode="aspectFit" style="width: 102rpx;height: 36rpx;" />
  30. <view style="font-size: 24rpx;color: #C4C4C4;margin-left: 10rpx;">
  31. :{{ form.total ? Number(form.total) > 10 ? '充足' : form.total : '' }}
  32. </view>
  33. </view>
  34. </view> -->
  35. </view>
  36. <view class="retailPrice" v-if="form.suggestedRetailPrice">
  37. 建议零售价:¥{{form.suggestedRetailPrice}}
  38. </view>
  39. <view style="margin-top: 14rpx;">
  40. <u--text :text="form.cname" size="26rpx" color='#797979' lines="2"></u--text>
  41. </view>
  42. <view style="display: flex;justify-content: space-between;margin-top: 8rpx;align-items: center;">
  43. <view style="font-size: 24rpx;color: #C4C4C4;">
  44. 库存:{{ form.balanceQuantity ? Number(form.balanceQuantity) > 10 ? '充足' : Number(form.balanceQuantity) : '' }}
  45. </view>
  46. <u-number-box v-model="form.goodsNum" :min="1" :max="form.balanceQuantity" buttonSize="53rpx"
  47. color="#414141" bgColor="#fff" iconStyle="color:#A4A4A4"></u-number-box>
  48. </view>
  49. <view style="display: flex;;margin-top: 8rpx;align-items:center;" v-for="(item, index) in inventoryData"
  50. :key="index">
  51. <view style="display: flex;align-items: center;">
  52. <view style="border-radius: 10rpx;border: 2rpx solid #F6744D;font-size: 26rpx;color: #03803B;">
  53. {{item.storageName}}
  54. </view>
  55. <view style="font-size: 24rpx;color: #C4C4C4;margin-left: 35rpx;">
  56. 库存:{{Number(item.storeInventory) > 10 ? '充足' : Number(item.storeInventory)}}
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <view style="background-color: #fff;padding:62rpx 62rpx 37rpx 62rpx;margin-bottom: 20rpx;">
  62. <view style="font-weight: 400;font-size: 26rpx;color: #797979;" v-show="arrow">
  63. <view style="display: flex;justify-content: space-between;">
  64. <view>
  65. 规格型号:{{ form.typeNo||'-' }}
  66. </view>
  67. <view>
  68. 花纹:{{ form.brandItem || '-' }}
  69. </view>
  70. </view>
  71. <view style="display: flex;justify-content: space-between;margin-top: 52rpx;">
  72. <view>
  73. 产地:{{ form.placeProduction || '-' }}
  74. </view>
  75. <view>
  76. 防爆:{{ form.explosionProof == 1 ? "是" : "否" }}
  77. </view>
  78. </view>
  79. <view style="display: flex;justify-content: space-between;margin-top: 52rpx;">
  80. <view>
  81. 原厂:{{ form.originalFactory == 1 ? '是' : '否' }}
  82. </view>
  83. <view>
  84. 自修复:{{ form.selfRecovery == 1 ? '是' : '否' }}
  85. </view>
  86. </view>
  87. <view style="display: flex;justify-content: space-between;margin-top: 52rpx;">
  88. <view>
  89. 商品描述:{{ form.goodsDescription || '-' }}
  90. </view>
  91. </view>
  92. </view>
  93. <view style="display: flex;justify-content: center;margin-top: 49rpx;" @click="arrow = !arrow">
  94. <image v-if="arrow" src="/static/images/goods/10.png" mode="aspectFit"
  95. style="width: 33rpx;height: 26rpx;" />
  96. <image v-if="!arrow" src="/static/images/goods/10.png" mode="aspectFit"
  97. style="width: 33rpx;height: 26rpx;transform: rotate(180deg)" />
  98. </view>
  99. </view>
  100. <view style="background-color: #fff;padding:40rpx 62rpx;margin-bottom: 20rpx;">
  101. <view style="font-weight: 400;font-size: 30rpx;color: #F6744D;">
  102. 商品详情
  103. </view>
  104. </view>
  105. <view style="width: 100%;background-color: #fff;">
  106. <view v-html="form.detailsText"></view>
  107. </view>
  108. <view class="text-bottom">
  109. </view>
  110. <view style="width: 100%;position: fixed;bottom: 0;background-color: #fff;border-top:2rpx #F2F2F2 solid;"
  111. class="dynamic-bottom">
  112. <view style="display: flex;justify-content: space-around;align-items: center;">
  113. <view style="width: 80rpx;display: flex;flex-direction: column;align-items: center;"
  114. @click="shoppingCart">
  115. <view class="">
  116. <image src="/static/images/goods/16.png" mode="aspectFit" style="width: 31rpx;height: 28rpx;" />
  117. </view>
  118. <view style="font-size: 24rpx;color: #797979;">
  119. 购物车
  120. </view>
  121. </view>
  122. <view style="width:360rpx;">
  123. <debounce-button style="border-radius: 100rpx;" v-if="form.balanceQuantity > 0" @click="placeAnOrder"
  124. text="加入购物车" bgColor='#03803B'></debounce-button>
  125. <debounce-button v-if="form.balanceQuantity == 0&&form.total==0" type="primary" @click="soldOut" text="已售罄"
  126. color="#c8c9cc" shape='circle'></debounce-button>
  127. </view>
  128. </view>
  129. </view>
  130. </view>
  131. </template>
  132. <script>
  133. import {
  134. appDetail,
  135. appDetailNew,
  136. addToCart,
  137. appModifyPrice,
  138. listShareV1,
  139. getGoodsDetailStockByCloud,
  140. appDetailCloud,
  141. } from '@/api/home/index.js'
  142. import {
  143. isProcurement
  144. } from '@/api/goods/index.js'
  145. export default {
  146. data() {
  147. return {
  148. inventoryDataForm: {},
  149. checkboxValue: [],
  150. form: {
  151. },
  152. arrow: true,
  153. dataList: [],
  154. screen: {},
  155. columns: [],
  156. keyName: '',
  157. showWarehouse: false,
  158. dataForm: {
  159. thisLocality: {},
  160. offsite: {}
  161. },
  162. inventoryFalse: true,
  163. inventoryData: [],
  164. // 审核状态
  165. checkStatus: '',
  166. }
  167. },
  168. onLoad(onLoad) {
  169. this.checkStatus = uni.getStorageSync('checkStatus');
  170. this.loadList(onLoad)
  171. },
  172. methods: {
  173. loadList(onLoad) {
  174. appDetail(onLoad).then(res => {
  175. this.dataForm = res.data
  176. res.data.goodsNum = 1
  177. this.form = res.data
  178. })
  179. },
  180. loadByCloud(id) {
  181. getGoodsDetailStockByCloud(id).then(res => {
  182. this.inventoryData = res.data.weChatDetailStockVos
  183. this.inventoryDataForm.storeInventory = res.data.storeInventory
  184. this.inventoryDataForm.storeInventoryShare = res.data.storeInventoryShare
  185. })
  186. },
  187. // previewImage() {
  188. // uni.previewImage({
  189. // current: 0, // 当前显示图片的索引,默认是0
  190. // urls: [this.form.url] // 需要预览的图片HTTP链接列表
  191. // });
  192. // },
  193. // admin确认
  194. adminConfirm() {
  195. uni.clearStorageSync();
  196. uni.redirectTo({
  197. url: '/pages/login/index'
  198. })
  199. },
  200. soldOut() {
  201. uni.showToast({
  202. icon: "none",
  203. title: '商品已售罄',
  204. mask: true
  205. });
  206. },
  207. backToHome() {
  208. uni.$u.route({
  209. url: 'pages/home/index',
  210. type: "switchTab"
  211. })
  212. },
  213. // 加入购物车
  214. placeAnOrder() {
  215. uni.showLoading({
  216. title: '加载中',
  217. mask: true
  218. });
  219. addToCart({
  220. ...this.form,
  221. }).then(res => {
  222. uni.hideLoading();
  223. uni.showToast({
  224. title: "加入购物车成功",
  225. icon: "none",
  226. });
  227. }).catch(err => {
  228. uni.hideLoading();
  229. })
  230. },
  231. confirmWarehouse(e) {
  232. appModifyPrice({
  233. id: e.value[0].id
  234. }).then(res => {
  235. this.form.salesCompanyName = e.value[0].salesCompanyName
  236. this.form.salesCompanyId = e.value[0].salesCompanyId
  237. this.form.mallPrice = res.data.mallPrice
  238. this.form.balanceQuantity = res.data.balanceQuantity
  239. this.showWarehouse = false
  240. })
  241. },
  242. shoppingCart() {
  243. uni.reLaunch({
  244. url: '/pages/shoppingCart/index'
  245. })
  246. }
  247. }
  248. }
  249. </script>
  250. <style lang="scss" scoped>
  251. ::v-deep .u-number-box {
  252. border: 2rpx #E1E1E1 solid;
  253. border-radius: 8rpx;
  254. }
  255. ::v-deep .u-number-box__minus {
  256. border-right: 2rpx #E1E1E1 solid;
  257. }
  258. ::v-deep .u-number-box__plus {
  259. border-left: 2rpx #E1E1E1 solid;
  260. }
  261. ::v-deep .u-button {
  262. height: 60rpx;
  263. }
  264. .dynamic-bottom {
  265. padding: 20rpx 20rpx 0 20rpx;
  266. padding-bottom: calc(env(safe-area-inset-bottom) + 30rpx);
  267. }
  268. .text-bottom {
  269. height: calc(env(safe-area-inset-bottom) + 126rpx);
  270. }
  271. .retailPrice {
  272. display: flex;
  273. color: #909399;
  274. font-size: 22rpx;
  275. height: 28rpx;
  276. }
  277. </style>