耀实惠小程序
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.

446 lines
9.2 KiB

2 years ago
  1. <template>
  2. <view>
  3. <u-tabs barWidth="83" fontSize="34" :current="current" :scrollable="false" :list="nav_tabs" @change="tabsCilck"></u-tabs>
  4. <!-- 信息展示 -->
  5. <view class="order_box">
  6. <!-- medicine -->
  7. <image class="medicine_pic" :src="img_url+'medicine.png'" mode="" @click="toMedicine"></image>
  8. <!-- 审核中 -->
  9. <view class="audit" v-if="current == 0 && orderList.length!==0">
  10. <view class="item" v-for="item in orderList">
  11. <view class="left_box">
  12. <view class="time">
  13. <text class="time_text">{{item.createTime.substr(0,10)}}</text>
  14. </view>
  15. <view class="left_row">
  16. <image width="175" height="175" :src="item.pic2"></image>
  17. <view class="info">
  18. <text class="info_title">用药人</text>
  19. <view class="name_box">
  20. <text class="name">{{item.drugUserList[0].name}}</text>
  21. <text class="name_btn">{{item.drugUserList[0].labelValue}}</text>
  22. </view>
  23. <view class="other_info">
  24. <text>{{item.drugUserList[0].labelValue.sex == 1?'男': '女'}}</text>
  25. <!-- <text>{{item.drugUserList[0].age}}</text> -->
  26. <text>{{item.drugUserList[0].phone.substr(0,3)+'****'+item.drugUserList[0].phone.substr(7)}}</text>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <!-- 已通过 -->
  34. <view class="pass" v-if="current == 1 && orderList.length!==0">
  35. <view class="item">
  36. <view class="time">
  37. <text class="time_text">2022-05-01</text>
  38. </view>
  39. <u-read-more :toggle="true" showHeight="900" color="#6C6C6C" textIndent="0" fontSize="24rpx"
  40. closeText="展开(共5件)" openText="收起">
  41. <view class="goods_item">
  42. <!-- <image src="../../../static/agreement-tips.png" mode=""></image> -->
  43. <view class="right_box">
  44. <text class="title">消毒杀菌 有效抑制99.9%细菌 300g/</text>
  45. <view class="center_box">
  46. <view class="money_box">
  47. <!-- <text class="min red"></text> -->
  48. <text class="bigs red">123</text>
  49. </view>
  50. <text class="back_iconx">×2</text>
  51. </view>
  52. <text>规格 预防感冒家庭常备全家同享 粉色</text>
  53. </view>
  54. </view>
  55. </u-read-more>
  56. <view class="total_box">
  57. <text class="text_price">合计</text>
  58. <text class="price">12346</text>
  59. </view>
  60. <button class="gather" v-if="current==1">去支付</button>
  61. </view>
  62. </view>
  63. <view class="empty_box" v-if="orderList.length==0">
  64. <image :src="IMG_URL+'empty.png'" alt=""></image>
  65. <text class="text_">{{current==0?'暂无审核记录':'暂无通过记录'}}</text>
  66. </view>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. import config_img from "@/utils/js/config.js";
  72. import { IMG_URL } from '@/env.js'
  73. export default {
  74. data() {
  75. return {
  76. IMG_URL,
  77. img_url: config_img.img_url,
  78. current: 0,
  79. nav_tabs: [{
  80. name: '审核中',
  81. }, {
  82. name: '已通过',
  83. }],
  84. url: '',
  85. orderList: [],
  86. pageNo: 1,
  87. pageSize: 10,
  88. total: null,
  89. isLock: true //锁
  90. }
  91. },
  92. onUnload() {
  93. uni.switchTab({
  94. url: this.url
  95. })
  96. },
  97. onLoad() {
  98. let pages_url = getCurrentPages();
  99. this.url = pages_url[0].route;
  100. this.patterPage();
  101. },
  102. onPullDownRefresh() {
  103. this.orderList = [];
  104. this.pageNo = 1;
  105. this.total = null;
  106. this.isLock = true;
  107. this.patterPage()
  108. },
  109. onReachBottom() {
  110. if(this.isLock){
  111. this.isLock = false;
  112. if(this.total !== null && this.pageNo * this.pageSize >= this.total){
  113. this.$Toast('没有更多数据了哦!');
  114. setTimeout(()=>{
  115. this.isLock = true;
  116. },3000)
  117. return
  118. }
  119. this.pageNo+=1;
  120. this.patterPage();
  121. }
  122. },
  123. methods: {
  124. patterPage() {
  125. uni.showLoading();
  126. const params = {
  127. pageNo: this.pageNo,
  128. pageSize: this.pageSize,
  129. type: this.current
  130. }
  131. this.$api('patterPage',params).then(res => {
  132. let { code, result, message} = res;
  133. if(code == 200) {
  134. if(this.total == null) {
  135. this.total = result.total;
  136. }
  137. // 处理 图片
  138. result.records.forEach(item => {
  139. item.pic2 = item.pic.split(',')[0]
  140. })
  141. this.orderList = this.orderList.concat(result.records)
  142. console.log(result);
  143. }else {
  144. this.$Toast(message);
  145. }
  146. uni.hideLoading()
  147. uni.stopPullDownRefresh()
  148. this.isLock = true;
  149. }).catch(err => {
  150. uni.hideLoading()
  151. this.isLock = true;
  152. uni.stopPullDownRefresh()
  153. this.$Toast(err.message);
  154. })
  155. },
  156. toMedicine() {
  157. // prescription 0 标记从哪来 0 从home页来
  158. uni.navigateTo({
  159. url: "./medicine/index?type=''&prescription=0"
  160. })
  161. },
  162. tabsCilck(index) {
  163. console.log(index)
  164. this.current = index;
  165. // 初始化
  166. this.orderList = [];
  167. this.pageNo = 1;
  168. this.total = null;
  169. this.isLock = true;
  170. this.patterPage();
  171. },
  172. }
  173. }
  174. </script>
  175. <style lang="scss" scoped>
  176. .empty_box{
  177. width: 100%;
  178. height: 76vh;
  179. display: flex;
  180. flex-direction: column;
  181. justify-content: center;
  182. align-items: center;
  183. image{
  184. width: 371rpx;
  185. height: 371rpx;
  186. }
  187. .text_{
  188. margin-top: 10rpx;
  189. font-size: 36rpx;
  190. font-weight: bold;
  191. color: #01AEEA;
  192. }
  193. }
  194. /deep/ .u-scroll-box {
  195. display: flex;
  196. }
  197. .order_box {
  198. background-color: #F5F5F5;
  199. min-height: 100vh;
  200. // margin-top: 22rpx;
  201. padding-bottom: 20rpx;
  202. .medicine_pic {
  203. margin: 26rpx 40rpx 0;
  204. width: 668rpx;
  205. height: 157rpx;
  206. }
  207. .audit {
  208. .item {
  209. margin-top: 22rpx;
  210. background-color: #fff;
  211. &:first-child {
  212. margin-top: 27rpx;
  213. }
  214. }
  215. }
  216. .pass {
  217. .item {
  218. margin-top: 17rpx;
  219. background-color: #fff;
  220. &:first-child {
  221. margin-top: 21rpx;
  222. }
  223. }
  224. }
  225. .item {
  226. width: 711rpx;
  227. margin: 0 auto;
  228. border-radius: 24rpx;
  229. padding-bottom: 10rpx;
  230. box-shadow: 0 3rpx 6rpx 0 rgba(0, 0, 0, 0.16);
  231. .left_box {
  232. }
  233. .left_row {
  234. display: flex;
  235. margin-left: 40rpx;
  236. margin-top: 12rpx;
  237. margin-bottom: 12rpx;
  238. image {
  239. width: 175rpx;
  240. height: 191rpx;
  241. }
  242. .info {
  243. margin-left: 24rpx;
  244. display: flex;
  245. flex-direction: column;
  246. .info_title {
  247. font-size: 30rpx;
  248. color: #707070;
  249. margin-top: 17rpx;
  250. margin-bottom: 17rpx;
  251. }
  252. .name_box {
  253. font-size: 28rpx;
  254. color: #000;
  255. margin-bottom: 17rpx;
  256. .name{
  257. font-size: 34rpx;
  258. }
  259. .name_btn {
  260. margin-left: 10rpx;
  261. font-size: 24rpx;
  262. color: #0C85FF;
  263. border-radius: 10rpx;
  264. border: 1px solid #0C85FF;
  265. padding: 5rpx 10rpx;
  266. }
  267. }
  268. .other_info {
  269. display: flex;
  270. font-size: 32rpx;
  271. padding-bottom: 23rpx;
  272. color: #000;
  273. text {
  274. margin-right: 38rpx;
  275. }
  276. }
  277. }
  278. }
  279. .time {
  280. width: 648rpx;
  281. margin: 0 auto;
  282. padding-top: 15rpx;
  283. padding-bottom: 15rpx;
  284. border-bottom: 1px solid rgba(112,112,112,0.2);
  285. display: flex;
  286. justify-content: space-between;
  287. font-size: 32rpx;
  288. .time_text {
  289. color: #333;
  290. }
  291. .phone {
  292. color: #01AEEA;
  293. }
  294. }
  295. .goods_item {
  296. display: flex;
  297. width: 648rpx;
  298. margin: 0 auto;
  299. margin-top: 22rpx;
  300. padding-bottom: 26rpx;
  301. border-bottom: 1px solid rgba(112,112,112,0.2);
  302. &:last-child {
  303. border-bottom: none;
  304. }
  305. image {
  306. width: 200rpx;
  307. height: 200rpx;
  308. border-radius: 20rpx;
  309. }
  310. .right_box {
  311. display: flex;
  312. flex-direction: column;
  313. font-size: 26rpx;
  314. margin-left: 25rpx;
  315. .title {
  316. color: #000;
  317. font-size: 33rpx;
  318. line-height: 39rpx;
  319. }
  320. .center_box {
  321. display: flex;
  322. justify-content: space-between;
  323. color: #01AEEA;
  324. font-size: 32rpx;
  325. .money_box {
  326. .red {
  327. color: #DB0618;
  328. }
  329. .min {
  330. font-size: 20rpx;
  331. }
  332. .bigs {
  333. font-size: 36rpx;
  334. }
  335. }
  336. .back_money{
  337. color: #fff;
  338. background-color: #FFA952;
  339. border-radius: 15rpx;
  340. height: 47rpx;
  341. line-height: 47rpx;
  342. box-sizing: border-box;
  343. font-size: 34rpx;
  344. padding-left: 15rpx;
  345. padding-right: 15rpx;
  346. }
  347. .back_iconx{
  348. font-size: 38rpx;
  349. }
  350. }
  351. }
  352. }
  353. .total_box {
  354. display: flex;
  355. width: 648rpx;
  356. margin: 0 auto;
  357. justify-content: flex-end;
  358. font-size: 28rpx;
  359. // margin-top: 34rpx;
  360. padding-bottom: 16rpx;
  361. border-bottom: 1px solid rgba(112,112,112,0.2);
  362. .sum_back_momey{
  363. height: 47rpx;
  364. line-height: 47rpx;
  365. border-radius: 10rpx;
  366. padding-left: 15rpx;
  367. padding-right: 15rpx;
  368. margin-right: 45rpx;
  369. color: #fff;
  370. background-color: #FFA952;
  371. font-size: 30rpx;
  372. }
  373. .text_price{
  374. font-size: 34rpx;
  375. }
  376. .price{
  377. font-size: 36rpx;
  378. }
  379. text {
  380. &:last-child {
  381. color: #DB0618;
  382. }
  383. }
  384. }
  385. .gather {
  386. width: 235rpx;
  387. height: 60rpx;
  388. margin-top: 10rpx;
  389. margin-right: 21rpx;
  390. border: 1rpx solid #01AEEA;
  391. color: #01AEEA;
  392. font-size: 30rpx;
  393. border-radius: 30rpx;
  394. line-height: 60rpx;
  395. display: flex;
  396. justify-content: center;
  397. align-items: center;
  398. }
  399. }
  400. position: relative;
  401. .received {
  402. position: absolute;
  403. top: 18rpx;
  404. right: 122rpx;
  405. width: 181rpx;
  406. height: 108rpx;
  407. }
  408. }
  409. </style>