procurement.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <template>
  2. <view class="proInit">
  3. <tui-skeleton
  4. v-if="skeletonShow"
  5. backgroundColor="#fafafa"
  6. borderRadius="10rpx"
  7. :isLoading="true"
  8. :loadingType="5"
  9. ></tui-skeleton>
  10. <view v-else>
  11. <tui-tabs :tabs="tabs" :currentTab="currentTab" @change="handlerTabs" class="tab"></tui-tabs>
  12. <view
  13. class="tabsContent"
  14. v-for="(item, index) in procurementList"
  15. :key="index"
  16. :style="{ marginTop: index === 0 ? '40px' : '' }"
  17. >
  18. <proCard @modelData="modelData" :proTabId='currentTab' :procuretInfo="item" @popupAdd="popupAdd" @popupChange="popupChange" />
  19. </view>
  20. </view>
  21. <!-- 弹窗提示 -->
  22. <tui-modal
  23. :show="modal"
  24. @click="handleClick"
  25. @cancel="hideMobel"
  26. :content="contentModalText"
  27. :button="modalButton"
  28. color="#333"
  29. :size="32"
  30. shape="circle"
  31. :maskClosable="false"
  32. ></tui-modal>
  33. <view class="add_btn" @click="procurementAdd">
  34. <image style="width: 100%;height: 100%;" src="@/static/procurement/add_pro.png"></image>
  35. </view>
  36. <tui-bottom-popup :zIndex="1002" :maskZIndex="1001" :show="popupShow" @close="handlerPopupClose">
  37. <view class="popup_content">
  38. <view class="pro_popup_title">参与需求</view>
  39. <view class="popup_form">
  40. <view class="popup_form_item">商品图片:</view>
  41. <view class="popup_img">
  42. <image style="width: 100%;height: 100%;" src="" mode="aspectFill"></image>
  43. </view>
  44. </view>
  45. <view class="popup_form">
  46. <view class="popup_form_item">商品名称:</view>
  47. <view class="popup_form_name">
  48. 韩国恩盛进口氢洁气小气泡清韩进口氢洁气小气泡清 口氢洁气小气泡清韩进口氢洁气小气泡
  49. </view>
  50. </view>
  51. <form>
  52. <view class="uni-form-item uni-column">
  53. <view class="title">
  54. <text style="font-size: 26rpx;color: #F85050;">*</text>
  55. 期望单价:
  56. </view>
  57. <view style="position: relative;">
  58. <view class="input_icon">¥</view>
  59. <input class="uni-input" focus placeholder="自动获得焦点" />
  60. </view>
  61. </view>
  62. <view class="uni-form-item uni-column">
  63. <view class="title">
  64. <text style="font-size: 26rpx;color: #F85050;">*</text>
  65. 采购数量:
  66. </view>
  67. <view style="position: relative;">
  68. <input class="uni-input" focus placeholder="自动获得焦点" />
  69. </view>
  70. </view>
  71. <view class="submit_btn">
  72. <button class="popup_btn cancel">取消</button>
  73. <button class="popup_btn submit">确定</button>
  74. </view>
  75. </form>
  76. </view>
  77. </tui-bottom-popup>
  78. <!--加载loadding-->
  79. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  80. <!-- <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore> -->
  81. <!--加载loadding-->
  82. </view>
  83. </template>
  84. <script>
  85. import proCard from './components/procurement_card.vue'
  86. import jumpMixins from '@/mixins/jumpMixins.js'
  87. import { mapState } from 'vuex'
  88. export default {
  89. components: {
  90. proCard
  91. },
  92. mixins: [jumpMixins],
  93. data() {
  94. return {
  95. skeletonShow: true, // loading
  96. // tab 栏切换
  97. tabs: [
  98. {
  99. name: '全部'
  100. },
  101. {
  102. name: '我参与的'
  103. },
  104. {
  105. name: '我发起的'
  106. }
  107. ],
  108. currentTab: 0, // tab 当前所在栏
  109. modal: false, // 弹窗
  110. contentModalText: '确定退出参与该需求吗?', // 弹窗内容
  111. // 弹窗配置
  112. modalButton: [
  113. {
  114. text: '取消',
  115. type: 'gray',
  116. plain: true //是否空心
  117. },
  118. {
  119. text: '确认',
  120. customStyle: {
  121. color: '#fff',
  122. bgColor: 'linear-gradient(90deg, #F28F31 0%, #F3B574 100%)'
  123. },
  124. plain: false
  125. }
  126. ],
  127. // 组件传递集采需求
  128. proDataInfo: {},
  129. popupShow: false, // 底部上移栏
  130. loadding: false, // 下拉刷新
  131. pullUpOn: false, // 下拉刷新
  132. // 分页参数
  133. pageInfo: {
  134. pageNo: 1,
  135. pageSize: 10
  136. },
  137. // 所有数据
  138. procurementList: [
  139. {
  140. id: 1,
  141. userId: 2,
  142. productImage: '',
  143. productName: '测试',
  144. price: 1000,
  145. number: 1000,
  146. saveTime: '2023-1-2',
  147. createUserId: 33,
  148. isAchieve: 0,
  149. delFlag: 0,
  150. clubName: '测试机构',
  151. isInvolved: 0
  152. }
  153. ],
  154. // 下拉刷新
  155. nomoreText: '已经被掏空了~'
  156. }
  157. },
  158. watch: {
  159. currentTab(val) {
  160. if (val) {
  161. }
  162. }
  163. },
  164. computed: {
  165. // 是否登录
  166. ...mapState(['hasLogin'])
  167. },
  168. onShow() {
  169. this.procurementAllList()
  170. if (this.hasLogin) {
  171. this.skeletonShow = false
  172. } else {
  173. // this.$api.redirectTo('/pages/login/login')
  174. this.skeletonShow = false
  175. }
  176. },
  177. methods: {
  178. // tab 切换
  179. handlerTabs($event) {
  180. this.currentTab = $event.index
  181. },
  182. // 弹窗确认或取消
  183. handleClick($event) {
  184. this.modal = false
  185. if ($event.index === 1) {
  186. }
  187. },
  188. hideMobel($event) {},
  189. // 组件传递商品详情
  190. modelData(proData) {
  191. this.modal = true
  192. this.proDataInfo = proData
  193. },
  194. // 关闭底部
  195. handlerPopupClose() {
  196. this.popupShow = false
  197. },
  198. // 我要参与
  199. popupAdd($event) {
  200. console.log($event)
  201. this.popupShow = true
  202. },
  203. // 修改
  204. popupChange($event) {
  205. uni.navigateTo({
  206. url: '/pages/goods/procurement_info'
  207. })
  208. },
  209. // 发布
  210. procurementAdd() {
  211. uni.navigateTo({
  212. url: '/pages/goods/procurementAdd'
  213. })
  214. },
  215. /**
  216. * 网络请求
  217. */
  218. // 全部集采
  219. async procurementAllList() {
  220. try {
  221. const data = await this.ProcurementService.procurementAllList(this.pageInfo)
  222. this.procurementList = data.list
  223. } catch (error) {
  224. console.log(error)
  225. }
  226. }
  227. }
  228. }
  229. </script>
  230. <style lang="scss">
  231. page {
  232. background-color: #f7f7f7;
  233. }
  234. .proInit {
  235. background-color: #f7f7f7;
  236. }
  237. .proInit .tab {
  238. position: fixed;
  239. left: 0;
  240. top: 0;
  241. z-index: 9;
  242. }
  243. ::v-deep .tui-tabs-slider.data-v-9311a734 {
  244. background: #f3b574 !important;
  245. }
  246. ::v-deep .tui-tabs-title.tui-tabs-active {
  247. color: #f3b574 !important;
  248. }
  249. .tabsContent {
  250. background-color: #f7f7f7;
  251. padding: 16rpx 32rpx;
  252. // margin-bottom: 32rpx;
  253. }
  254. .add_btn {
  255. width: 100rpx;
  256. height: 100rpx;
  257. position: fixed;
  258. bottom: 129rpx;
  259. right: 34rpx;
  260. }
  261. .popup_content {
  262. padding: 0 64rpx;
  263. }
  264. .pro_popup_title {
  265. font-size: 32rpx;
  266. font-weight: bold;
  267. color: #333333;
  268. margin: 40rpx auto;
  269. text-align: center;
  270. }
  271. .popup_form {
  272. margin-bottom: 32rpx;
  273. }
  274. .popup_form .popup_form_item {
  275. color: #999999;
  276. font-size: 26rpx;
  277. margin-bottom: 16rpx;
  278. }
  279. .popup_form .popup_img {
  280. width: 136rpx;
  281. height: 136rpx;
  282. border: 1px dotted black;
  283. }
  284. .popup_form .popup_form_name {
  285. color: #333333;
  286. font-size: 26rpx;
  287. font-weight: 400;
  288. line-height: 44rpx;
  289. }
  290. .uni-form-item .title {
  291. color: #999999;
  292. font-size: 26rpx;
  293. margin-bottom: 16rpx;
  294. }
  295. .input_icon {
  296. position: absolute;
  297. left: 15rpx;
  298. top: 24rpx;
  299. color: #b2b2b2;
  300. font-size: 26rpx;
  301. }
  302. .uni-form-item .uni-input {
  303. height: 80rpx;
  304. border: 1px solid #b2b2b2;
  305. border-radius: 6rpx 6rpx 6rpx 6rpx;
  306. font-size: 26rpx;
  307. padding-left: 47rpx;
  308. margin-bottom: 32rpx;
  309. }
  310. .submit_btn {
  311. margin-top: 56rpx;
  312. height: 84rpx;
  313. display: flex;
  314. justify-content: space-between;
  315. align-items: center;
  316. margin-bottom: 50rpx;
  317. }
  318. .submit_btn .popup_btn {
  319. width: 280rpx;
  320. height: 100%;
  321. border-radius: 45rpx 45rpx 45rpx 45rpx;
  322. text-align: center;
  323. line-height: 84rpx;
  324. }
  325. ::v-deep .submit_btn .cancel {
  326. background-color: #fff4e6;
  327. color: #f3b574;
  328. font-size: 32rpx;
  329. }
  330. ::v-deep .submit_btn .submit {
  331. background-color: #f3b574;
  332. color: #ffffff;
  333. font-size: 32rpx;
  334. }
  335. </style>