耀实惠小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

291 lines
6.4 KiB

  1. <template>
  2. <view>
  3. <!-- <u-tabs font-size="34" barWidth="83" :current="current" :scrollable="false" :list="nav_tabs" @change="tabsCilck"></u-tabs> -->
  4. <u-tabs :list="nav_tabs" :is-scroll="false" :current="current" @change="tabsCilck"></u-tabs>
  5. <!-- 信息展示 -->
  6. <view class="order_box">
  7. <view class="item" v-if="list.length !==0" v-for="(item,index) in list" :key="index">
  8. <view class="time">
  9. <text class="time_text">{{item.createTime}}</text>
  10. <!-- <text class="phone" @click="call">一键拨号 &nbsp;&nbsp;(13545625412)</text> -->
  11. </view>
  12. <view class="">
  13. <u-read-more :toggle="true" showHeight="900" color="#6C6C6C" textIndent="0" fontSize="24rpx" closeText="展开(共5件)" openText="收起">
  14. <view class="goods_item">
  15. <image :src="item.dbOrderDetail.goodPic.split(',')[0]" mode=""></image>
  16. <view class="right_box">
  17. <text class="title">{{item.goodId_dictText}}</text>
  18. <view class="center_box">
  19. <view class="money_box">
  20. <text class="min red"></text>
  21. <text class="bigs red">{{item.dbOrderDetail.goodPrice}}</text>
  22. </view>
  23. <text>×{{item.dbOrderDetail.goodNum}}</text>
  24. </view>
  25. <text>{{item.dbOrderDetail.goodSku}}</text>
  26. </view>
  27. </view>
  28. </u-read-more>
  29. <!-- <view class="total_box">
  30. <text>合计</text>
  31. <text>12346</text>
  32. </view> -->
  33. <button class="gather" v-if="current==0">审核中</button>
  34. <view class="btn_gather" v-if="current==1">
  35. <!-- <button class="gather">修改防疫信息</button> -->
  36. <button class="gather" @click="tosetInfo(item)">修改处方信息</button>
  37. </view>
  38. <button class="gather" v-if="current==2" @click="toShopingPages">去购买</button>
  39. </view>
  40. </view>
  41. <!-- 已收货 图片 -->
  42. <view class="empty_box" v-else>
  43. <image :src="IMG_URL+'empty.png'" alt=""></image>
  44. <text class="text_">暂无订单记录</text>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import { IMG_URL } from '@/env.js'
  51. export default {
  52. data() {
  53. return {
  54. IMG_URL,
  55. current: 0,
  56. nav_tabs: [{
  57. name: '审核中',
  58. }, {
  59. name: '待修改',
  60. }, {
  61. name: '已通过',
  62. }],
  63. list: [],
  64. pageNo: 1,
  65. pageSize: 10
  66. }
  67. },
  68. onPullDownRefresh() {
  69. uni.showLoading();
  70. this.pageNo = 1,
  71. this.pageSize = 10,
  72. this.isMore = 1;
  73. this.getList();
  74. },
  75. onReachBottom() {
  76. if (this.isMore == 3 || this.isMore == 2) return
  77. this.pageNo+=1;
  78. this.isMore = 2;
  79. this.getList();
  80. },
  81. onLoad () {
  82. this.getList();
  83. },
  84. onUnload() {
  85. const pagelist = getCurrentPages();
  86. console.log(pagelist)
  87. if(pagelist[pagelist.length-2].route == '/pagesC/confirmOrder/confirmOrder'){
  88. uni.switchTab({
  89. url: '/pages/my/my'
  90. })
  91. }
  92. },
  93. methods: {
  94. //${id}&medicineMan=${medicineMan}
  95. tosetInfo(item) {
  96. console.log("点击出现的数据")
  97. console.log(item)
  98. uni.navigateTo({
  99. url:'/pagesC/subscribe/subscribe?&goodsId='+item.goodId
  100. });
  101. },
  102. toShopingPages() {
  103. uni.navigateTo({
  104. url: "/pages/my/order/index?status=0"
  105. })
  106. },
  107. tabsCilck(index) {
  108. this.list = [];
  109. console.log(index)
  110. this.current = index
  111. this.getList();
  112. },
  113. getList () {
  114. this.$api('getOrderYyList', { state: this.current ,pageNo: this.pageNo, pageSize: this.pageSize, })
  115. .then(res => {
  116. let { code, result, message } = res;
  117. uni.stopPullDownRefresh()
  118. if (code === 200) {
  119. this.isMore = result.records.length >= this.pageSize ? 1 : 3
  120. this.list = this.pageNo > 1 ? this.list.concat(result.records) : result.records
  121. uni.hideLoading();
  122. } else {
  123. this.isMore = 3
  124. this.$Toast(message);
  125. uni.hideLoading();
  126. }
  127. })
  128. .catch(err => {
  129. this.isMore = 3
  130. uni.stopPullDownRefresh()
  131. this.$Toast(err.message);
  132. });
  133. }
  134. }
  135. }
  136. </script>
  137. <style lang="scss" scoped>
  138. /deep/ .u-scroll-box {
  139. display: flex;
  140. }
  141. .empty_box{
  142. width: 100%;
  143. height: 80vh;
  144. display: flex;
  145. flex-direction: column;
  146. justify-content: center;
  147. align-items: center;
  148. image{
  149. width: 371rpx;
  150. height: 371rpx;
  151. }
  152. .text_{
  153. margin-top: 10rpx;
  154. font-size: 36rpx;
  155. font-weight: bold;
  156. color: #01AEEA;
  157. }
  158. }
  159. .order_box {
  160. margin-top: 22rpx;
  161. padding-bottom: 20rpx;
  162. .item {
  163. width: 711rpx;
  164. margin: 0 auto;
  165. border-radius: 24rpx;
  166. padding-bottom: 21rpx;
  167. box-shadow: 0 3rpx 6rpx 0 rgba(0, 0, 0, 0.16);
  168. .time{
  169. width: 648rpx;
  170. margin: 0 auto;
  171. padding-top: 34rpx;
  172. padding-bottom: 15rpx;
  173. border-bottom: 1px solid rgba(112,112,112,0.2);
  174. display: flex;
  175. justify-content: space-between;
  176. font-size: 32rpx;
  177. .time_text {
  178. color: #333;
  179. }
  180. .phone{
  181. color: #01AEEA;
  182. }
  183. }
  184. .goods_item{
  185. display: flex;
  186. width: 648rpx;
  187. margin: 0 auto;
  188. margin-top: 22rpx;
  189. padding-bottom: 26rpx;
  190. border-bottom: 1px solid #707070;
  191. &:last-child{
  192. border-bottom: none;
  193. }
  194. image{
  195. width: 200rpx;
  196. height: 200rpx;
  197. border-radius: 20rpx;
  198. }
  199. .right_box{
  200. display: flex;
  201. flex-direction: column;
  202. font-size: 26rpx;
  203. margin-left: 25rpx;
  204. .title{
  205. color: #000;
  206. font-size: 33rpx;
  207. line-height: 39rpx;
  208. }
  209. .center_box{
  210. display: flex;
  211. justify-content: space-between;
  212. color: #01AEEA;
  213. font-size: 32rpx;
  214. .money_box{
  215. .red{
  216. color: #DB0618;
  217. }
  218. .min{
  219. font-size: 20rpx;
  220. }
  221. .bigs{
  222. font-size: 36rpx;
  223. }
  224. }
  225. }
  226. }
  227. }
  228. .total_box{
  229. display: flex;
  230. width: 648rpx;
  231. margin: 0 auto;
  232. justify-content: flex-end;
  233. font-size: 36rpx;
  234. margin-top: 34rpx;
  235. padding-bottom: 16rpx;
  236. border-bottom: 1px solid rgba(112,112,112,0.2);
  237. text{
  238. &:last-child{
  239. color: #DB0618;
  240. }
  241. }
  242. }
  243. .btn_gather{
  244. display: flex;
  245. justify-content: flex-end;
  246. button{
  247. margin: 0;
  248. height: 60rpx;
  249. margin-top: 20rpx;
  250. &:nth-child(1){
  251. margin-right: 10rpx;
  252. }
  253. }
  254. }
  255. .gather{
  256. width: 255rpx;
  257. height: 60rpx;
  258. margin-top: 23rpx;
  259. margin-right: 21rpx;
  260. border: 1rpx solid #01AEEA;
  261. color: #01AEEA;
  262. font-size: 30rpx;
  263. border-radius: 30rpx;
  264. line-height: 60rpx;
  265. }
  266. }
  267. position: relative;
  268. .received{
  269. position: absolute;
  270. top: 18rpx;
  271. right: 122rpx;
  272. width: 181rpx;
  273. height: 108rpx;
  274. }
  275. }
  276. </style>