release.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  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)">隐藏</view>
  27. <view class='anniu' @click="switch1(item)">显示</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. if (res.errmsg == "Success") {
  86. this.$api.msg('隐藏成功!')
  87. return
  88. }
  89. })
  90. .catch(res => {
  91. uni.showToast({
  92. title: res.errmsg,
  93. icon:'none',
  94. duration: 2000
  95. })
  96. });
  97. },
  98. fail: () => {},
  99. complete: () => {}
  100. })
  101. // }
  102. },
  103. edit(item){
  104. uni.navigateTo({
  105. url: `/pageD/myRelease/buyEdit?id=${item.id}`
  106. })
  107. },
  108. deleteRelease(item){
  109. // if (!this.hasLogin) {
  110. uni.showModal({
  111. // title: '登录提示',
  112. content: '确定删除该信息?',
  113. showCancel: true,
  114. confirmText: '确定',
  115. success: (e) => {
  116. this.$api.doRequest('post','/procurementPlanInfo/api/deleteProcurementPlan',{id:item.id}).then(res => {
  117. this.procurementPlanInfos = res.data.data.records
  118. if (res.errmsg == "Success") {
  119. this.$api.msg('删除成功!')
  120. this.getList()
  121. return
  122. }
  123. })
  124. .catch(res => {
  125. uni.showToast({
  126. title: res.errmsg,
  127. icon:'none',
  128. duration: 2000
  129. })
  130. });
  131. },
  132. fail: () => {},
  133. complete: () => {}
  134. })
  135. // }
  136. },
  137. releaseChange(e){
  138. this.receivePrivate = e.detail.value
  139. this.release = this.releaseType[this.receivePrivate];
  140. this.pageSize = 1
  141. if(this.release == "我要卖粮"){
  142. uni.navigateTo({
  143. url: `/pageD/myRelease/sellGrain`
  144. })
  145. }else if(this.release == "我要买粮"){
  146. uni.navigateTo({
  147. url: `/pageD/myRelease/buyGrain`
  148. })
  149. }
  150. },
  151. details(item){
  152. uni.navigateTo({
  153. url: `/pageD/myRelease/buyDetails?id=${item.id}`
  154. })
  155. },
  156. getList(){
  157. // this.procurementPlanInfo.pcFlag = "1"
  158. this.$api.doRequest('get','/procurementPlanInfo/selectProcurementPlanInfo',this.procurementPlanInfo).then(res => {
  159. this.procurementPlanInfos = res.data.data.records
  160. })
  161. .catch(res => {
  162. uni.showToast({
  163. title: res.errmsg,
  164. icon:'none',
  165. duration: 2000
  166. })
  167. });
  168. }
  169. }
  170. }
  171. </script>
  172. <style>
  173. .center {
  174. padding: 10px 20px;
  175. background-color: #F5F6FA;
  176. }
  177. .informations {
  178. background-color: #FFFFFF;
  179. margin-top: 20px;
  180. border-radius: 16px;
  181. padding: 10px;
  182. }
  183. .labels {
  184. display: inline-flex;
  185. line-height: 20px;
  186. margin-right: 40px;
  187. }
  188. .fabuBut{
  189. margin-bottom: 0px;
  190. }
  191. .logo{
  192. width: 36px;
  193. height: 24px;
  194. background-color: #FEECE6;
  195. color: #FE6430;
  196. border-radius: 8px;
  197. padding: 3px;
  198. margin-top: 2px;
  199. }
  200. .grain{
  201. font-size: 18px;
  202. color: #333333;
  203. font-weight: 600;
  204. margin-left: 20px;
  205. }
  206. .address{
  207. margin-left: 56px;
  208. font-size: 14px;
  209. color: #333333;
  210. }
  211. .weight{
  212. margin-left: 56px;
  213. font-size: 14px;
  214. color: #878C9C;
  215. }
  216. .unitPrice{
  217. font-size: 22px;
  218. font-weight: 600;
  219. /* margin-left: 200px; */
  220. position: absolute;
  221. /* text-align: right; */
  222. right: 40px;
  223. }
  224. /* .amount{
  225. width: 100%;
  226. } */
  227. .amount{
  228. margin-left: 10px;
  229. font-size: 12px;
  230. }
  231. .status{
  232. position: absolute;
  233. right: 40px;
  234. }
  235. .put{
  236. color: #22C572;
  237. font-size: 14px;
  238. }
  239. .put1{
  240. color: #FE6430;
  241. font-size: 14px;
  242. }
  243. .put2{
  244. color: #FB1E1E;
  245. font-size: 14px;
  246. }
  247. .anniu{
  248. width: 60px;
  249. height: 30px;
  250. border: 1px solid #CDCDCD;
  251. border-radius: 16px;
  252. text-align: center;
  253. line-height: 30px;
  254. margin-left: 10px;
  255. }
  256. .btn{
  257. width: 100%;
  258. border-radius: 20px;
  259. background-color: #22C572;
  260. margin-top: 10px;
  261. }
  262. </style>