list.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. <template>
  2. <view class="content">
  3. <view>
  4. <view class="active-title-box">
  5. <view class="header-title">{{activeDesc.name}}</view>
  6. <view style="color: gray;">{{activeDesc.start_time}}</view>
  7. </view>
  8. <view class="active-box" v-for="(item,index) in activiList" :key="index" style="flex-direction: column;">
  9. <view class="active-header">
  10. <!-- <view class="active-type">
  11. <text style="margin: 0 auto;">头像</text>
  12. </view> -->
  13. <view class="active-content-box">
  14. <view class="active-content margin-top-3">
  15. <view class="active-name">{{item.author}}</view>
  16. </view>
  17. <view class="active-content">
  18. <view class="active-date">{{item.addtime}}</view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="active-content-box-img margin-top-3">
  23. <view v-for="(img,indexImg) in item.pic_list" :key="indexImg">
  24. <image :src="img.pic_url" mode="aspectFit" @click="showLarge(item.pic_list,indexImg)"></image>
  25. </view>
  26. </view>
  27. <view class="margin-top-3" style="color: #007AFF;">
  28. {{item.web_url}}
  29. </view>
  30. <view class="edit-icon-box">
  31. <image src="/static/edit-icon.png" mode="aspectFit" v-if="item.edit_auth" @click="goEditPage(item.id)"></image>
  32. <image src="/static/del-icon.png" mode="aspectFit" v-if="item.del_auth" @click="delProcess(item.id)"></image>
  33. </view>
  34. </view>
  35. <button class="footer-box-record" @click="goRecord()">上传记录</button>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import md5 from "@/common/md5.js";
  41. export default {
  42. components: {
  43. },
  44. data() {
  45. return {
  46. isAuth:getApp().globalData.globalAuth,
  47. userHeadImg: getApp().globalData.user_headUrl,
  48. userNickName:getApp().globalData.user_name,
  49. globalUrl:getApp().globalData.shareUrl,
  50. activeId:'',
  51. branchId:'',
  52. recordId:'',
  53. activeDesc:{},
  54. activiList:[]
  55. };
  56. },
  57. onLoad(option) {
  58. this.recordId = option.id;
  59. this.readDesc(this.recordId)
  60. //this.readActive(this.recordId)
  61. },
  62. onShow() {
  63. this.readActive(this.recordId)
  64. },
  65. methods: {
  66. goEditPage(id){
  67. uni.navigateTo({
  68. url:'./record?id='+ id + '&bId=' + this.branchId + '&aId=' + this.activeId + '&types=edit'
  69. })
  70. },
  71. showLarge(urlList,index) {
  72. let imgList = urlList,imgArr = [];
  73. imgList.forEach((item,index)=>{
  74. imgArr.push(item.pic_url_resize)
  75. })
  76. uni.previewImage({
  77. urls:imgArr,
  78. current:imgArr[index],
  79. longPressActions: {
  80. itemList: ["发送给朋友", "保存图片"],
  81. success: function (data) {},
  82. fail: function (err) {
  83. console.log(err.errMsg);
  84. },
  85. },
  86. });
  87. },
  88. delProcessRequeset(delId){
  89. let md5Sign = md5(
  90. "method=" +"activity" + "&timestamp=" + getApp().globalData.globalTimestamp +
  91. "&secret=" + getApp().globalData.secret
  92. );
  93. let url = getApp().globalData.shareUrl +"api/api.php" +
  94. "?method=activity&action=process_del&timestamp=" +
  95. getApp().globalData.globalTimestamp + "&sign=" + md5Sign;
  96. uni.request({
  97. url: url,
  98. method: "POST",
  99. header: {
  100. "content-type": "application/x-www-form-urlencoded",
  101. },
  102. data: {
  103. openid: getApp().globalData.open_id,
  104. id:delId
  105. },
  106. success: (res) => {
  107. if (res.data.code === 200) {
  108. uni.showToast({
  109. title: "删除成功",
  110. icon: "none",
  111. duration: 2500,
  112. success:()=>{
  113. this.readActive(this.activeId)
  114. }
  115. });
  116. }
  117. },
  118. fail: () => {
  119. console.log("连接失败");
  120. },
  121. });
  122. },
  123. delProcess(id){
  124. let that = this;
  125. uni.showModal({
  126. title: "确定删除此记录吗?",
  127. success(res) {
  128. if (res.confirm) {
  129. that.delProcessRequeset(id);
  130. } else if (res.cancel) {
  131. console.log("用户点击取消");
  132. }
  133. },
  134. });
  135. },
  136. readDesc(id){
  137. let md5Sign = md5(
  138. "method=" +"activity" + "&timestamp=" + getApp().globalData.globalTimestamp +
  139. "&secret=" + getApp().globalData.secret
  140. );
  141. let url = getApp().globalData.shareUrl +"api/api.php" +
  142. "?method=activity&action=info_by_id&timestamp=" +
  143. getApp().globalData.globalTimestamp + "&sign=" + md5Sign;
  144. uni.request({
  145. url: url,
  146. method: "POST",
  147. header: {
  148. "content-type": "application/x-www-form-urlencoded",
  149. },
  150. data: {
  151. openid:getApp().globalData.open_id,
  152. id:id
  153. },
  154. success: (res) => {
  155. if (res.data.code === 200) {
  156. this.activeDesc = res.data.data;
  157. this.branchId = res.data.data.branch_id;
  158. this.activeId = res.data.data.id;
  159. }
  160. },
  161. fail: () => {
  162. console.log("连接失败");
  163. },
  164. });
  165. },
  166. readActive(id){
  167. let md5Sign = md5(
  168. "method=" +"activity" + "&timestamp=" + getApp().globalData.globalTimestamp +
  169. "&secret=" + getApp().globalData.secret
  170. );
  171. let url = getApp().globalData.shareUrl +"api/api.php" +
  172. "?method=activity&action=process_list&timestamp=" +
  173. getApp().globalData.globalTimestamp + "&sign=" + md5Sign;
  174. uni.request({
  175. url: url,
  176. method: "POST",
  177. header: {
  178. "content-type": "application/x-www-form-urlencoded",
  179. },
  180. data: {
  181. openid:getApp().globalData.open_id,
  182. activity_id:id
  183. },
  184. success: (res) => {
  185. if (res.data.code === 200) {
  186. let listArr = res.data.data.list;
  187. listArr.forEach((item)=>{
  188. item.pic_list.forEach((child)=>{
  189. child.pic_url = this.globalUrl + child.pic_url;
  190. child.pic_url_resize = this.globalUrl + child.pic_url_resize;
  191. })
  192. })
  193. this.activiList = listArr;
  194. }
  195. },
  196. fail: () => {
  197. console.log("连接失败");
  198. },
  199. });
  200. },
  201. goRecord(){
  202. uni.navigateTo({
  203. url:'./record?bId=' + this.branchId + '&aId=' + this.activeId + '&types=add'
  204. })
  205. }
  206. },
  207. };
  208. </script>
  209. <style lang="scss" scoped>
  210. .content {
  211. display: flex;
  212. flex-direction: column;
  213. .self-inf {
  214. // border-radius: 0rpx 0rpx 100% 100%;
  215. .img-name-box {
  216. height: 150rpx;
  217. margin-top: 20rpx;
  218. margin-bottom: 20rpx;
  219. display: flex;
  220. align-items: center;
  221. width: 85%;
  222. .auth-btn {
  223. margin-left: 30rpx;
  224. margin-top: 20rpx;
  225. font-size: 28rpx;
  226. background-color: #02a7f0;
  227. color: #fff;
  228. }
  229. .heade-img {
  230. z-index: 1;
  231. width: 100rpx;
  232. height: 100rpx;
  233. border-radius: 50%;
  234. // margin-left: 80rpx;
  235. }
  236. }
  237. .nickname {
  238. font-weight: 600;
  239. font-size: 28rpx;
  240. margin-left: 30rpx;
  241. margin-top: 20rpx;
  242. color: #555;
  243. letter-spacing: 1rpx;
  244. }
  245. }
  246. }
  247. .org-info-box {
  248. display: flex;
  249. justify-content: space-evenly;
  250. height: 80rpx;
  251. align-items: center;
  252. width: 100%;
  253. border-top: 1px solid #d4d4d4;
  254. color: #555;
  255. font-size: 28rpx;
  256. background: #fff;
  257. }
  258. .org-line {
  259. width: 1px;
  260. height: 82rpx;
  261. background: #d4d4d4;
  262. }
  263. .header-title {
  264. margin-top: 3%;
  265. margin-bottom: 1%;
  266. font-size: 32rpx;
  267. font-weight: bold
  268. }
  269. .active-title-box {
  270. padding-left: 5%;
  271. font-size: 26rpx;
  272. height: 100rpx;
  273. border-bottom: 4px solid #eeeeee;
  274. .time-select-box {
  275. width: 32%;
  276. margin-left: 5%;
  277. }
  278. picker {
  279. width: 25%;
  280. border: 1px solid #d7d7d7;
  281. height: 60rpx;
  282. line-height: 60rpx;
  283. border-radius: 10rpx;
  284. margin-left: 20rpx;
  285. padding: 0 10rpx;
  286. position: relative;
  287. image {
  288. width: 20rpx;
  289. height: 20rpx;
  290. position: absolute;
  291. top: 11px;
  292. right: 5px;
  293. }
  294. }
  295. button {
  296. width: 24%;
  297. font-size: 25rpx;
  298. background: #4988fd;
  299. color: #fff;
  300. margin-left: 25rpx;
  301. }
  302. }
  303. .margin-top-3 {
  304. margin-top: 3%;
  305. }
  306. .active-box {
  307. display: flex;
  308. position: relative;
  309. font-size: 28rpx;
  310. padding: 30rpx;
  311. border-bottom: 1px solid #d7d7d7;
  312. .active-header {
  313. display: flex;
  314. width: 100%;
  315. }
  316. .active-type {
  317. width: 100rpx;
  318. height: 100rpx;
  319. border-radius: 50%;
  320. background-color: #ccc;
  321. text-align: center;
  322. display: flex;
  323. align-items: center;
  324. font-size: 26rpx;
  325. color: #fff;
  326. }
  327. .active-content-box{
  328. display: flex;
  329. flex-direction: column;
  330. margin-left: 20rpx;
  331. }
  332. .active-content-box-img {
  333. display: flex;
  334. justify-content: space-around;
  335. image {
  336. width: 240rpx;
  337. height: 160rpx;
  338. }
  339. }
  340. .active-content {
  341. display: flex;
  342. align-items: center;
  343. height: 45rpx;
  344. font-size: 26rpx;
  345. .active-name {
  346. font-size: 30rpx;
  347. margin-right: 10rpx;
  348. }
  349. .active-date {
  350. color: #ccc;
  351. }
  352. }
  353. .edit-icon-box {
  354. position: absolute;
  355. right: 10px;
  356. top: 10px;
  357. image {
  358. width: 35rpx;
  359. height: 35rpx;
  360. margin-right: 10rpx;
  361. }
  362. }
  363. .bg-yellow {
  364. background-color: #ffdd40;
  365. }
  366. .bg-red {
  367. background-color: #ec808d;
  368. }
  369. .bg-blue {
  370. background-color: #81d3f8;
  371. }
  372. }
  373. .footer-box-record{
  374. position: fixed;
  375. bottom: 0;
  376. background-color:#f59a23;
  377. width: 100%;
  378. border-radius: 0;
  379. color: #fff;
  380. font-size: 32rpx;
  381. }
  382. </style>