release.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <template>
  2. <view class="center">
  3. <view class="introduce-section">
  4. <view class="informations " v-for="(item , index) in procurementPlanInfos" :Key="index">
  5. <view @click="details(item)">
  6. <view class="flex">
  7. <view class="logo flex">
  8. 买粮
  9. </view>
  10. <text class="grain">{{item.goodsName}}</text>
  11. <view class="status">
  12. <view v-if='item.status=="已驳回"' class='put2'>未通过</view>
  13. <view v-if='item.status=="待审核"' class='put1'>审核中</view>
  14. <view v-if='item.status=="已认证"' class='put'>已通过</view>
  15. </view>
  16. </view>
  17. <view class="address">{{item.receivePrivate}}{{item.receiveCity}}{{item.receiveArea}}</view>
  18. <view class="flex ">
  19. <view class="weight" >{{item.weight > 0 ? item.weight : 0}}吨</view>
  20. <text class="unitPrice">{{item.unitPrice}} <text class="amount">元/吨</text></text>
  21. </view>
  22. </view>
  23. <hr style="margin: 16px 0; color: #EEEEEE;">
  24. <view class="flex" style="right: 10px;">
  25. <view @click='edit(item)' v-if='item.status!="待审核"' class='anniu'>编辑</view>
  26. <view class='anniu' @click="switch1(item)" v-if="item.showFlag == 0">隐藏</view>
  27. <view class='anniu' @click="switch1(item)" v-if="item.showFlag == 1">显示</view>
  28. <view class='anniu' @click="deleteRelease(item)">删除</view>
  29. </view>
  30. <!-- <view v-if='item.status=="已驳回"' class='cu-tag radius line-pink put'>未通过</view>
  31. <view v-if='item.status=="待审核"' class='cu-tag radius line-pink put'>审核中</view>
  32. <view v-if='item.status=="已认证"' class='cu-tag radius line-pink put'>已通过</view> -->
  33. </view>
  34. </view>
  35. <!-- <view class="page-bottom">
  36. <view class="action-btn-group">
  37. <picker style='display:inline-block;' @change="releaseChange" :value="releases" :range="releaseType">
  38. <button type="primary" class=" action-btn no-border add-cart-btn" >发布</button>
  39. <view class="picker">
  40. {{releases>-1?releaseType[releases]:''}}
  41. </view>
  42. </picker>
  43. </view>
  44. </view> -->
  45. <picker style='display:inline-block;width: 100%;' @change="releaseChange" :value="releases" :range="releaseType">
  46. <button type="primary" class="btn" >发布</button>
  47. <view class="picker">
  48. {{releases>-1?releaseType[releases]:''}}
  49. </view>
  50. </picker>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. data() {
  56. return {
  57. releaseType:["我要卖粮","我要买粮"],
  58. release:'',
  59. releases:'',
  60. receivePrivate:'',
  61. procurementPlanInfo:{
  62. pageSize:10,
  63. currentPage:1
  64. },
  65. releaseIndex:"",
  66. pageSize:10,
  67. currentPage:1,
  68. procurementPlanInfos:[],
  69. }
  70. },
  71. onLoad(){
  72. this.getList()
  73. },
  74. methods: {
  75. switch1(item){
  76. // if (!this.hasLogin) {
  77. uni.showModal({
  78. // title: '登录提示',
  79. content: '隐藏后该信息不再展示给其他用户,是否确定隐藏?',
  80. showCancel: true,
  81. confirmText: '确定',
  82. success: (e) => {
  83. this.$api.doRequest('post','/procurementPlanInfo/api/editStatus',{id:item.id,flag:0}).then(res => {
  84. // this.procurementPlanInfos = res.data.data.records
  85. console.log(res)
  86. if (res.data.message == "Success") {
  87. this.$api.msg('隐藏成功!')
  88. this.getList()
  89. return
  90. }
  91. })
  92. .catch(res => {
  93. uni.showToast({
  94. title: res.errmsg,
  95. icon:'none',
  96. duration: 2000
  97. })
  98. });
  99. },
  100. fail: () => {},
  101. complete: () => {}
  102. })
  103. // }
  104. },
  105. edit(item){
  106. uni.navigateTo({
  107. url: `/pageD/myRelease/buyEdit?id=${item.id}`
  108. })
  109. },
  110. deleteRelease(item){
  111. // if (!this.hasLogin) {
  112. uni.showModal({
  113. // title: '登录提示',
  114. content: '确定删除该信息?',
  115. showCancel: true,
  116. confirmText: '确定',
  117. success: (e) => {
  118. this.$api.doRequest('post','/procurementPlanInfo/api/deleteProcurementPlan',{id:item.id}).then(res => {
  119. if (res.data.message == "Success") {
  120. this.$api.msg('删除成功!')
  121. this.getList()
  122. return
  123. }
  124. })
  125. .catch(res => {
  126. uni.showToast({
  127. title: res.errmsg,
  128. icon:'none',
  129. duration: 2000
  130. })
  131. });
  132. },
  133. fail: () => {},
  134. complete: () => {}
  135. })
  136. // }
  137. },
  138. releaseChange(e){
  139. this.receivePrivate = e.detail.value
  140. this.release = this.releaseType[this.receivePrivate];
  141. this.pageSize = 1
  142. if(this.release == "我要卖粮"){
  143. uni.navigateTo({
  144. url: `/pageD/myRelease/sellGrain`
  145. })
  146. }else if(this.release == "我要买粮"){
  147. uni.navigateTo({
  148. url: `/pageD/myRelease/buyGrain`
  149. })
  150. }
  151. },
  152. details(item){
  153. uni.navigateTo({
  154. url: `/pageD/myRelease/buyDetails?id=${item.id}`
  155. })
  156. },
  157. getList(){
  158. // this.procurementPlanInfo.pcFlag = "1"
  159. this.$api.doRequest('get','/procurementPlanInfo/selectProcurementPlanInfo',this.procurementPlanInfo).then(res => {
  160. this.procurementPlanInfos = res.data.data.records
  161. })
  162. .catch(res => {
  163. uni.showToast({
  164. title: res.errmsg,
  165. icon:'none',
  166. duration: 2000
  167. })
  168. });
  169. }
  170. }
  171. }
  172. </script>
  173. <style>
  174. .center {
  175. padding: 10px 20px;
  176. background-color: #F5F6FA;
  177. }
  178. .informations {
  179. background-color: #FFFFFF;
  180. margin-top: 20px;
  181. border-radius: 16px;
  182. padding: 10px;
  183. }
  184. .labels {
  185. display: inline-flex;
  186. line-height: 20px;
  187. margin-right: 40px;
  188. }
  189. .fabuBut{
  190. margin-bottom: 0px;
  191. }
  192. .logo{
  193. width: 36px;
  194. height: 24px;
  195. background-color: #FEECE6;
  196. color: #FE6430;
  197. border-radius: 8px;
  198. padding: 3px;
  199. margin-top: 2px;
  200. }
  201. .grain{
  202. font-size: 18px;
  203. color: #333333;
  204. font-weight: 600;
  205. margin-left: 20px;
  206. }
  207. .address{
  208. margin-left: 56px;
  209. font-size: 14px;
  210. color: #333333;
  211. }
  212. .weight{
  213. margin-left: 56px;
  214. font-size: 14px;
  215. color: #878C9C;
  216. }
  217. .unitPrice{
  218. font-size: 22px;
  219. font-weight: 600;
  220. /* margin-left: 200px; */
  221. position: absolute;
  222. /* text-align: right; */
  223. right: 40px;
  224. }
  225. /* .amount{
  226. width: 100%;
  227. } */
  228. .amount{
  229. margin-left: 10px;
  230. font-size: 12px;
  231. }
  232. .status{
  233. position: absolute;
  234. right: 40px;
  235. }
  236. .put{
  237. color: #22C572;
  238. font-size: 14px;
  239. }
  240. .put1{
  241. color: #FE6430;
  242. font-size: 14px;
  243. }
  244. .put2{
  245. color: #FB1E1E;
  246. font-size: 14px;
  247. }
  248. .anniu{
  249. width: 60px;
  250. height: 30px;
  251. border: 1px solid #CDCDCD;
  252. border-radius: 16px;
  253. text-align: center;
  254. line-height: 30px;
  255. margin-left: 10px;
  256. }
  257. .btn{
  258. width: 100%;
  259. border-radius: 20px;
  260. background-color: #22C572;
  261. margin-top: 10px;
  262. }
  263. </style>