audio.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <view class="content">
  3. <no-none v-if='list.length<=0'></no-none>
  4. <block v-else>
  5. <view @click="enit(item.id)" style="margin-top: 30rpx;" class="item" v-for="(item,index) of list" :key='index'>
  6. <view class="border-b item-title flex-y-center">
  7. <text>{{item.name}}</text>
  8. </view>
  9. <view class="item-bottom flex-y-center">
  10. <view class="flex-grow-1">
  11. <view class="box-pack-between item-bottom-right">
  12. <!-- <view> -->
  13. <text class="item-bottom-number">首页播报:</text>
  14. <text class="status"> {{item.status==1?'开启':'关闭'}}</text>
  15. <!-- </view> -->
  16. </view>
  17. <view class="box-pack-between item-bottom-right flex-y-center">
  18. <text><text class="item-bottom-number">创建时间</text>:{{item.create_time}}
  19. </text>
  20. <text class="iconfont icongengduo"></text>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </block>
  26. <view style="height: 75px;"></view>
  27. <navigator style="margin-bottom:0" url='./add' class="bottom-bar flex-center">
  28. <button formType="submit" class="flex-center ft28">+新增语音</button>
  29. </navigator>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. defaultIndex: 0,
  37. list: [],
  38. page: 1,
  39. $test: this.$test.$test,
  40. URL: getApp().globalData.URL,
  41. is_load:false,
  42. }
  43. },
  44. onLoad() {
  45. },
  46. onShow() {
  47. this.page=1;
  48. this.list=[];
  49. this.http();
  50. },
  51. onReachBottom(e) {
  52. if(!this.is_load){
  53. this.page = this.page + 1;
  54. this.http();
  55. }
  56. },
  57. methods: {
  58. enit(id){
  59. uni.navigateTo({
  60. url:"./add?id="+id
  61. })
  62. },
  63. previewImg(logourl) {
  64. let URL=this.URL+logourl;
  65. uni.previewImage({
  66. urls: [URL]
  67. });
  68. },
  69. del(id,index){
  70. uni.showModal({
  71. title: '提示',
  72. content: '是否要删除?',
  73. showCancel: true,
  74. cancelText: '取消',
  75. confirmText: '确定',
  76. success: res => {
  77. if(res.confirm){
  78. this.request({
  79. url:'comment/del',
  80. data: {
  81. id:id,
  82. },
  83. }).then(res => {
  84. console.log(res, "res")
  85. if (res.code === 200 || res.code === "200") {
  86. this.list.splice(index,1);
  87. }
  88. }).catch(()=>{
  89. uni.showToast({
  90. title:res.message,
  91. icon: "none",
  92. })
  93. });
  94. }
  95. },
  96. fail: () => {},
  97. complete: () => {}
  98. });
  99. },
  100. http() {
  101. let url ="Smdcshop/voice_index";
  102. this.request({
  103. url,
  104. data: {
  105. admin_id: uni.getStorageSync("admin_id"),
  106. },
  107. showLoading:true,
  108. }).then(res => {
  109. console.log(res, "res")
  110. if (res.code === "200") {
  111. this.list = this.list.concat(res.data);
  112. // res.data.list.length==0?(this.is_load=true):(this.is_load=false)
  113. }
  114. });
  115. },
  116. },
  117. }
  118. </script>
  119. <style lang="scss">
  120. page {
  121. background: #F5F7FA;
  122. }
  123. .status{
  124. border: 1rpx solid #3387FF;
  125. color: #fff;
  126. padding: 0 10rpx;
  127. background: #3387FF;
  128. border-radius: 4rpx;
  129. font-size: 24rpx;
  130. }
  131. .item {
  132. width: 690rpx;
  133. background: #ffffff;
  134. margin: 0 auto;
  135. padding: 0rpx 24rpx;
  136. opacity: 1;
  137. border-radius: 8rpx;
  138. box-shadow: 0rpx 6rpx 10rpx 0rpx rgba(213, 213, 213, 0.04);
  139. .item-title {
  140. opacity: 1;
  141. font-size: 28rpx;
  142. font-family: PingFang SC, PingFang SC-Medium;
  143. font-weight: 500;
  144. color: #333333;
  145. padding: 24rpx 0;
  146. .item-type {
  147. margin-right: 16rpx;
  148. width: 78rpx;
  149. height: 36rpx;
  150. font-size: 21rpx;
  151. opacity: 1;
  152. border-radius: 4rpx;
  153. color: #FFFFFF;
  154. border-bottom: 1rpx solid #F1F1F1;
  155. }
  156. .item-type-one {
  157. background: linear-gradient(134deg, #FF8C1A 2%, #FF8C1A 98%);
  158. }
  159. .item-type-two {
  160. background: linear-gradient(134deg, #f06767 2%, #f58484 98%);
  161. }
  162. .item-type-three {
  163. background: linear-gradient(134deg, #febe07 2%, #ffcc3e 98%);
  164. }
  165. }
  166. .item-bottom {
  167. font-size: 26rpx;
  168. padding: 20rpx 0 10rpx 0;
  169. color: #666666;
  170. .item-bottom-left {
  171. width: 90rpx;
  172. height: 90rpx;
  173. margin-right: 24rpx;
  174. min-width: 90rpx;
  175. margin-bottom: 16rpx;
  176. }
  177. .item-bottom-right {
  178. margin-bottom: 16rpx;
  179. .item-bottom-number {
  180. color: #99A0AD;
  181. }
  182. }
  183. }
  184. }
  185. .icongengduo {
  186. color: #999;
  187. font-size: 28rpx;
  188. }
  189. .bottom-bar {
  190. position: fixed;
  191. bottom: 0px;
  192. width: 100%;
  193. z-index: 1000;
  194. background: #FFFFFF;
  195. padding: 30rpx 0;
  196. }
  197. .bottom-bar button {
  198. text-align: center;
  199. width: 690rpx;
  200. height: 90rpx;
  201. background: linear-gradient(132deg, #3387FF 0%, #3387FF 100%);
  202. box-shadow: 0px 2rpx 12rpx #3387FF;
  203. opacity: 1;
  204. border-radius: 10rpx;
  205. color: #fff;
  206. }
  207. .label {
  208. min-width: 90rpx;
  209. height: 44rpx;
  210. line-height: 44rpx;
  211. padding: 0 10rpx;
  212. color: #FFFFFF;
  213. font-size: 24rpx;
  214. background-color: #1E9FFF;
  215. margin-left: 20rpx;
  216. text-align: center;
  217. }
  218. </style>